Documentation ¶
Index ¶
- Constants
- func Cause(err error) error
- func Errorf(code string, format string, args ...interface{}) error
- func InternalError(message string) error
- func InternalErrorf(format string, args ...interface{}) error
- func InternalWrapError(err error, message ...string) error
- func InternalWrapErrorf(err error, format string, args ...interface{}) error
- func IsCode(code string, err error) bool
- func New(code string, message string) error
- func Wrap(err error, code string, message string) error
- type ArgoError
Constants ¶
View Source
const ( CodeBadRequest = "ERR_BAD_REQUEST" CodeForbidden = "ERR_FORBIDDEN" CodeNotFound = "ERR_NOT_FOUND" CodeTimeout = "ERR_TIMEOUT" CodeInternal = "ERR_INTERNAL" )
Externally visible error codes
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause returns the underlying cause of the error, if possible. An error value has a cause if it implements the following interface:
type causer interface { Cause() error }
If the error does not implement Cause, the original error will be returned. If the error is nil, nil will be returned without further investigation.
func InternalError ¶
InternalError is a convenience function to create a Internal error with a message
func InternalErrorf ¶
InternalErrorf is a convenience function to format an Internal error
func InternalWrapError ¶
InternalWrapError annotates the error with the ERR_INTERNAL code and a stack trace, optional message
func InternalWrapErrorf ¶
InternalWrapErrorf annotates the error with the ERR_INTERNAL code and a stack trace, optional message
Types ¶
Click to show internal directories.
Click to hide internal directories.