twirperrors

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2018 License: BSD-2-Clause, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package twirperrors provides functions to adapt errors of the github.com/twitchtv/twirp package into errors compatible with the errors-go package.

Importing this package installs the aws errors adapters on the global set of adapters of the parent errors-go package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(err error) (error, bool)

Adapt checks the type of err is a twirp error, and adapts it to make error types discoverable using the errors.Is function.

This function is automatically installed as a global adapter when importing the neterrors package, a program likely should use errors.Adapt instead of calling this adapter directly.

func New

func New(err error) twirp.Error

New constructs a twirp error from another error. The error code is guessed by inspecting the types of err, and defaults to twirp.Unknown if the error had no types.

If err is nil the function returns nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL