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 ¶
const ( CodeBadRequest = "ERR_BAD_REQUEST" CodeForbidden = "ERR_FORBIDDEN" CodeNotFound = "ERR_NOT_FOUND" CodeNotImplemented = "ERR_NOT_IMPLEMENTED" CodeTimeout = "ERR_TIMEOUT" CodeInternal = "ERR_INTERNAL" )
Externally visible error codes
Variables ¶
This section is empty.
Functions ¶
func Cause ¶ added in v1.2.3
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 ¶ added in v1.2.3
InternalError is a convenience function to create a Internal error with a message
func InternalErrorf ¶ added in v1.2.3
InternalErrorf is a convenience function to format an Internal error
func InternalWrapError ¶ added in v1.2.3
InternalWrapError annotates the error with the ERR_INTERNAL code and a stack trace, optional message
func InternalWrapErrorf ¶ added in v1.2.3
InternalWrapErrorf annotates the error with the ERR_INTERNAL code and a stack trace, optional message
Types ¶
type ArgoError ¶ added in v1.2.3
type ArgoError interface {
Error() string
Code() string
Message() string
JSON() []byte
StackTrace() errors.StackTrace
Format(s fmt.State, verb rune)
}
ArgoError is an error interface that additionally adds support for stack trace, error code, and a JSON representation of the error