Documentation
¶
Index ¶
- func New(msg string) error
- func NewF(f string, args ...interface{}) error
- func NewWithCaller(msg string) error
- func NewWithCallerF(f string, args ...interface{}) error
- func PrintStackTrace()
- func Wrap(err error, msg string) error
- func WrapCaller(err error, msg string) error
- func WrapCallerF(err error, f string, args ...interface{}) error
- func WrapF(err error, f string, args ...interface{}) error
- type Caller
- type EnhancedError
- type ErrorList
- type ErrorListReadWrite
- type ErrorListReader
- type ErrorListWriter
- type InvalidArgumentError
- type PreConditionError
- type StackTrace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewF ¶
NewF creates an error with a formating similar to sprintf.
func NewWithCaller ¶
NewWithCaller creates a new error that contains stack information.
func NewWithCallerF ¶
NewWithCallerF creates a new error with a formatted message that contains stack information.
func Wrap ¶
Wrap accepts an error and a message and wraps them together in a single error.
func WrapCaller ¶
WrapCaller wraps an error with stack information. The intent is to use the error information in an error message for easier debugging.
func WrapCallerF ¶
WrapCallerF wraps an error with stack information with a formatted message. The intent is to use the additional error information for easier debugging.
Types ¶
type Caller ¶
type Caller struct {
// contains filtered or unexported fields
}
Caller represents the calling function within a given program state,
type EnhancedError ¶
type EnhancedError interface { error CausedBy() error Stack() *StackTrace }
EnhancedError describes an error that contains a stacktrace and any causes of the error.
type ErrorList ¶
type ErrorList interface { ErrorListReader ErrorListWriter WithLock(f func(errorList ErrorListReadWrite) error) error WithRLock(f func(errorList ErrorListReader) error) error }
type ErrorListReadWrite ¶
type ErrorListReadWrite interface { ErrorListReader ErrorListWriter }
type ErrorListReader ¶
type ErrorListWriter ¶
type ErrorListWriter interface { AddError(err error) // contains filtered or unexported methods }
type InvalidArgumentError ¶
type InvalidArgumentError struct {
// contains filtered or unexported fields
}
InvalidArgumentError is an error that is raised when a value is passed to a function that invalid.
func NewInvalidArgumentError ¶
func NewInvalidArgumentError(argName string) *InvalidArgumentError
NewInvalidArgumentError creates a new InvalidArgumentError, which is an error to signify that a function received an argument that it did not expect
func (*InvalidArgumentError) Error ¶
func (invalidArgumentError *InvalidArgumentError) Error() string
type PreConditionError ¶
type PreConditionError struct {
// contains filtered or unexported fields
}
PreConditionError is an error that occurs when there is a precondition that failed and thereby prevent a method or function from executing.
func NewPreconditionError ¶
func NewPreconditionError(msg string) *PreConditionError
NewPreconditionError creates a new precondition error. Precondition errors indicate that there was a precondiiton for a function that failed.
func (*PreConditionError) Error ¶
func (preCondition *PreConditionError) Error() string
type StackTrace ¶
type StackTrace []uintptr
StackTrace is a wrapper around the call to runtime.Callers.
func NewStackTrace ¶
func NewStackTrace(limit int) *StackTrace
NewStackTrace captures the state of the current stack.
func (*StackTrace) String ¶
func (stackTrace *StackTrace) String() string
String returns a string representation of the stack.