Documentation ¶
Overview ¶
Package skip provides a frame skipping version of vice for re-use in APIs.
For complete documentation, see the vice package.
Index ¶
- func Errorf(v Vice, skip uint, format string, a ...interface{}) error
- func New(v Vice, skip uint, text string) error
- func Seal(err error, v Vice, skip uint, text string) error
- func Sealf(err error, v Vice, skip uint, format string, a ...interface{}) error
- func Wrap(err error, v Vice, skip uint, text string) error
- func Wrapf(err error, v Vice, skip uint, format string, a ...interface{}) error
- type Vice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
Errorf returns an error that formats as the format specifier, and implements the behaviour described by the given Vice. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of Errorf.
The returned error contains a Frame set to the caller's location and implements Formatter to show this information when printed with details.
This func is intended to be used for implementing APIs on top of vice.
func New ¶
New returns an error that formats as the given text, and implements the behaviour described by the given Vice. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of New.
The returned error contains a Frame set to the caller's location and implements Formatter to show this information when printed with details.
This func is intended to be used for implementing APIs on top of vice.
func Seal ¶
Seal returns an error wrapping err with the supplied text, and a frame from the caller's stack. The returned error implements the behaviour described by the given Vice. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of Seal. If err is nil, Seal returns nil.
The error returned does not implement the Unwrap method.
This func is intended to be used for implementing APIs on top of vice.
func Sealf ¶
Sealf returns an error wrapping err with the supplied format specifier, and a frame from the caller's stack. The returned error implements the behaviour described by the given Vice. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of Sealf. If err is nil, Sealfreturns nil.
The error returned does not implement the Unwrap method.
This func is intended to be used for implementing APIs on top of vice.
func Wrap ¶
Wrap returns an error wrapping err with the supplied text, and a frame from the caller's stack. The returned error implements the behaviour described by the given Vice. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of Wrap. If err is nil, Wrap returns nil.
The error returned implements the Unwrap method, for programatically extracting the error chain.
This func is intended to be used for implementing APIs on top of vice.
func Wrapf ¶
Wrapf returns an error wrapping err with the supplied format specifier, and a frame from the caller's stack. The returned error implements the behaviour described by the given Vice. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of Wrapf. If err is nil, Wrapf returns nil.
The error returned implements the Unwrap method, for programatically extracting the error chain.
This func is intended to be used for implementing APIs on top of vice.