Documentation
¶
Overview ¶
Package errors.
This package can be used as drop-in replacement for https://golang.org/pkg/errors package.
This package provide StackTrace function to get the stack trace, use Wrap to make sure the error have stack trace
Index ¶
- func As(err error, target interface{}) bool
- func Errorf(format string, a ...interface{}) error
- func ErrorfWithDeep(deep int, format string, a ...interface{}) error
- func Format(err error) string
- func FormatWithDeep(err error, deep int) string
- func Ignore(err error)
- func Is(err, target error) bool
- func New(text string) error
- func NewWithCause(text string, cause error) error
- func NewWithCauseAndDeep(deep int, text string, cause error) error
- func NewWithDeep(deep int, text string) error
- func StackTrace(err error) []trace.Location
- func Unwrap(err error) error
- func Wrap(err error) error
- func WrapWithDeep(deep int, err error) error
- type StackTracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorfWithDeep ¶
like Errorf, but you can specify the stack trace deep
func Format ¶
Format representation of the Error, including stack trace.
Use err.Error() if you want to get just the error string
func FormatWithDeep ¶
FormatWithDeep representation of the Error, including stack trace with specified deep.
Use err.Error() if you want to get just the error string
func NewWithCause ¶
like New, but you can specify the cause error
func NewWithCauseAndDeep ¶
like NewWithCause, but you can specify the stack trace deep
func NewWithDeep ¶
like New, but you can specify the stack trace deep
func StackTrace ¶
Get stack trace of where the error is generated, return nil if none
func WrapWithDeep ¶
like Wrap, but you can specify the stack trace deep
Types ¶
type StackTracer ¶
StackTracer indicate that the error have stack trace