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 Format(err error) string
- func Is(err, target error) bool
- func New(text string) error
- func NewWithCause(text string, cause error) error
- func ParentStackTrace(err error) []trace.Location
- func Spawn(f func() error) <-chan error
- func StackTrace(err error) []trace.Location
- func Unwrap(err error) error
- func Wrap(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format representation of the Error, including stack trace.
Use err.Error() if you want to get just the error string
func NewWithCause ¶
like New, but you can specify the cause error
func ParentStackTrace ¶ added in v2.0.1
Get stack trace of parent go routine of the error, return nil if none
func Spawn ¶ added in v2.0.1
Spawn new go routine
run f, if f panic or returning non-nil error, it will be passed to the error channel
the error passed to the error chanel will return non-nil when passed to ParentStackTrace
func StackTrace ¶
Get stack trace of where the error is generated or wrapped, return nil if none
Types ¶
This section is empty.