errors

package
v0.0.0-...-8a4eff6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCode = 500

Default code defines the code that will be used by default when none is given. It is set to 500, Internal Server Error

Functions

func AssertCode

func AssertCode(t *testing.T, err error, code int)

func New

func New(msg string, fs ...ErrorEnricher) error

func WithCause

func WithCause(cause error) func(error) error

func WithCode

func WithCode(code int) func(error) error

Types

type Error

type Error interface {
	error

	Code() int
	Message() string
	Cause() error
}

type ErrorEnricher

type ErrorEnricher func(error) error

func BadRequest

func BadRequest() ErrorEnricher

func Forbidden

func Forbidden() ErrorEnricher

func NotFound

func NotFound() ErrorEnricher

Jump to

Keyboard shortcuts

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