errors

package
v0.0.0-...-ea56750 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CodeInternal ...
	CodeInternal = Code(iota)
	// CodeUnauthorized ...
	CodeUnauthorized
	// CodeNotFound ...
	CodeNotFound
	// CodeDependentServiceFailure ...
	CodeDependentServiceFailure
)

Variables

HTTPMapping is a mapping between error codes and http status codes.

Functions

func Annotate

func Annotate(err error, code Code) error

Annotate adds an error code to the given error.

Types

type Code

type Code = int

Code represents a canonical error code.

type Error

type Error struct {
	Code Code
	// contains filtered or unexported fields
}

Error is an implementation of the error interface.

func (Error) Error

func (err Error) Error() string

Jump to

Keyboard shortcuts

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