Documentation ¶
Index ¶
Constants ¶
const ( // ErrUnknown is returned when an unexpected error occurs. ErrUnknown = Error("err_unknown: unknown error occurred") // ErrInvalidRequest is returned when either the parameters or the request body is invalid. ErrInvalidRequest = Error("err_invalid_request: invalid request received") // ErrValidation is returned when the parameters don't pass validation. ErrValidation = Error("err_validation: failed validation") // ErrNotFound is returned when the requested resource is not found. ErrNotFound = Error("err_not_found: not found") )
const ErrSeperator = " -- "
ErrSeperator is used to determine the boundaries of the errors in the hierarchy.
Variables ¶
This section is empty.
Functions ¶
func As ¶
As just wraps errors.As as we don't want to alias the errors package everywhere to use it.
Types ¶
type Error ¶
type Error string
Error allows errors to be defined as const errors preventing modification and allowing them to be evaluated against wrapped errors.
func (Error) As ¶
As implements As(interface{}) bool which is used by errors.As (https://golang.org/pkg/errors/#As) allowing a Error to be set as the target if it matches the specified target type. This implementation only checks the top most wrapped error.
func (Error) Is ¶
Is implements https://golang.org/pkg/errors/#Is allowing a Error to check it is the same even when wrapped. This implementation only checks the top most wrapped error.