Documentation ¶
Index ¶
- Constants
- func AddContext(err error, field, message string) error
- func Cause(err error) error
- func GetContext(err error) *map[string]string
- func New(message string) error
- func Newf(message string, args ...interface{}) error
- func Wrap(err error, message string) error
- func Wrapf(err error, message string, args ...interface{}) error
- type ErrorType
Constants ¶
View Source
const ( // Unknown specifies an unknown error. Unknown = ErrorType(iota) // BadRequest specifies a validation realted error. BadRequest Unauthorized // Forbidden specifies authorization (permission) related errors. Forbidden // NotFound specifies errors related with non-existent resources. NotFound // Conflict specifies errors related with a resource conflict. Conflict // Unexpected specifies errors occurring unexpectedly, caused by technical issues. Unexpected )
Variables ¶
This section is empty.
Functions ¶
func AddContext ¶
AddContext adds context to the given error.
func GetContext ¶
GetContext returns an error's context.
Types ¶
type ErrorType ¶
type ErrorType string
ErrorType defines an enum for all possible kinds of errors.
Click to show internal directories.
Click to hide internal directories.