Documentation
¶
Index ¶
Constants ¶
View Source
const ErrUnknown = -1
ErrUnknown defines an unknown error
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error interface {
error
json.Marshaler
json.Unmarshaler
// Returns location of the error
Scene() ErrorScene
// Returns code of the error
Code() int
// Sets error code
WithCode(int) Error
// Returns message of the error
Message() string
// Returns functions that propagate the error
Wrappers() []ErrorScene
// Origin returns original error
Origin() error
// Returns true if the error wrapped
HasWrappers() bool
// Equal checks if given error equal original error
Equal(error) bool
// Is implements errors.Is
Is(err error) bool
// contains filtered or unexported methods
}
Error is a trouble :p. It keeps callers, if asked via Wrap().
func WrapStringf ¶
WrapStringf wraps given formatted error message
type ErrorScene ¶
type ErrorScene interface {
// Returns full path to the file where error occured
FileName() string
// Returns line number inside the error file
LineNumber() int
// Returns function name that cause the error
FuncName() string
}
ErrorScene is where an error occured
Click to show internal directories.
Click to hide internal directories.