Documentation ¶
Index ¶
- Variables
- func GroupErrors(errs ...error) error
- func PassError(err error) error
- 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
- type ErrorGroup
Constants ¶
This section is empty.
Variables ¶
View Source
var GroupErrorText = color.RedString("Additionally the following errors occurred:")
GroupErrorText is a string that is used to indicate a group of errors.
View Source
var PrintStackTrace = false
PrintStackTrace is a global variable that controls whether stack traces are printed or not.
Functions ¶
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 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 }
func (*Error) ForceStackTrace ¶
ForceStackTrace overrides the global PrintStackTrace setting.
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
Click to show internal directories.
Click to hide internal directories.