Documentation
¶
Overview ¶
Package fault provides tools for error handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIndexOutOfRange = errors.New("index out of range")
ErrIndexOutOfRange indicates attempt to access index that is out of range.
var ErrIntegerOverflow = errors.New("integer overflow")
ErrIntegerOverflow indicates integer overflow.
var ErrInvalidArgument = errors.New("invalid argument")
ErrInvalidArgument indicates attempt to pass invalid argument to function.
var ErrInvalidUse = errors.New("invalid use")
ErrInvalidUse indicates attempt to call function in invalid way.
var ErrNilPointer = errors.New("nil pointer")
ErrNilPointer indicates attempt to use nil pointer when value is required.
Functions ¶
func Recover ¶
func Recover(f func()) (err error)
Recover calls given function and returns recovered error if there was panic, or nil otherwise.
func Recovered ¶
Recovered returns error represented by given panic recovery result, or nil if result is nil.
func Trace ¶
Trace returns given error wrapped to attach calling goroutine's stack trace, or nil if error is nil.
Due to many various implementations of error handling in Golang ecosystem, it is strongly recommended to wrap only errors which format you know, because any other errors can already contain stack trace in one form or another. Also do not "rewrap" errors except if you really want to get multiple stack trace.
Types ¶
This section is empty.