Documentation
¶
Index ¶
- Variables
- func GetAllMessages(err error) []string
- func GetProperty(err error, key string) interface{}
- func GroupErrors(errs ...error) error
- func HasTag(err error, tag string) bool
- func IsBurritoError(err error) bool
- func PassError(err error) error
- func WalkError(err error, fn func(err *Error) bool)
- func WrapError(err error, text string) error
- func WrapErrorf(err error, text string, args ...interface{}) error
- func WrappedError(text string) error
- func WrappedErrorf(text string, args ...interface{}) error
- type Error
- func (r *Error) AddProperty(key string, value interface{})
- func (r *Error) AddTag(tag string)
- func (r *Error) Error() string
- func (r *Error) ForceStackTrace(enabled bool)
- func (r *Error) GetProperty(key string) interface{}
- func (r *Error) HasProperty(key string) bool
- func (r *Error) HasTag(tag string) bool
- type ErrorGroup
Constants ¶
This section is empty.
Variables ¶
var GroupErrorText = color.RedString("Additionally the following errors occurred:")
GroupErrorText is a string that is used to indicate a group of errors.
var PrintStackTrace = false
PrintStackTrace is a global variable that controls whether stack traces are printed or not.
Functions ¶
func GetAllMessages ¶ added in v1.0.2
GetAllMessages returns all messages of the error and all wrapped errors.
func GetProperty ¶ added in v1.0.4
GetProperty returns the property value for the specified key.
func GroupErrors ¶ added in v1.0.1
GroupErrors combines two or more errors into one. The first error is an error that occurred during the main operation. The other errors are errors that occurred during error handling.
func HasTag ¶ added in v1.0.2
HasTag returns true if the error is burrito error and has the specified tag.
func IsBurritoError ¶ added in v1.0.2
IsBurritoError returns true if the error is a burrito error.
func WalkError ¶ added in v1.0.4
WalkError walks the error tree and calls the specified function for each error. If the function returns true, the walk is aborted.
func WrapErrorf ¶
WrapErrorf wraps an error with a stack trace and adds additional formatted text information.
func WrappedError ¶
WrappedError creates an error with a stack trace from text.
func WrappedErrorf ¶
WrappedErrorf creates an error with a stack trace from formatted text.
Types ¶
type Error ¶
type Error struct { Err error Message *string File string Line int FuncName string ShowStackTrace *bool Tags []string Properties map[string]interface{} }
func AsBurritoError ¶ added in v1.0.2
AsBurritoError converts an error to a burrito error.
func (*Error) AddProperty ¶ added in v1.0.4
func (*Error) ForceStackTrace ¶
ForceStackTrace overrides the global PrintStackTrace setting.
func (*Error) GetProperty ¶ added in v1.0.4
func (*Error) HasProperty ¶ added in v1.0.4
type ErrorGroup ¶ added in v1.0.1
type ErrorGroup struct {
Errors []error
}
func (*ErrorGroup) Error ¶ added in v1.0.1
func (r *ErrorGroup) Error() string