Documentation
¶
Overview ¶
Contains utilities to use to create and consume simple errors.
Index ¶
- func Error(errorCode ErrorCode, msg string) error
- func Errorf(errorCode ErrorCode, msgFmt string, args ...interface{}) error
- func IsCausedBy(e error, errCode ErrorCode) bool
- func IsCausedByError(e, e2 error) bool
- func Wrapf(code ErrorCode, cause error, msgFmt string, args ...interface{}) error
- type ErrorCode
- type ErrorCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCausedBy ¶
Gets whether error is caused by another error with errCode.
func IsCausedByError ¶
Types ¶
type ErrorCode ¶
type ErrorCode = string
A generic error code type.
func GetErrorCode ¶
Gets the error code of the passed error if it has one.
type ErrorCollection ¶
type ErrorCollection []error
A helper object that collects errors.
func (*ErrorCollection) Append ¶
func (e *ErrorCollection) Append(err error) bool
func (ErrorCollection) Error ¶
func (e ErrorCollection) Error() string
func (ErrorCollection) ErrorOrDefault ¶
func (e ErrorCollection) ErrorOrDefault() error
Click to show internal directories.
Click to hide internal directories.