error

package
v0.0.0-...-c4bde49 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("not found")
	ErrRequestBody  = errors.New("invalid request body")
	ErrInternal     = errors.New("internal server error")
	ErrUnauthorized = errors.New("unauthorized access")
)

Functions

func EncodeError

func EncodeError(_ context.Context, err error, w http.ResponseWriter)

encode errors from business-logic

Types

type Error

type Error struct {
	Code   int                `json:"-"`
	Errors map[string][]error `json:"errors"`
}

func NewError

func NewError(code int, err error) Error

func (Error) Error

func (e Error) Error() string

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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