Documentation ¶
Index ¶
- func Cause(err error) error
- func Errorf(format string, args ...interface{}) error
- func New(message string) error
- func WithMessage(err error, message string) error
- func WithMessagef(err error, format string, args ...interface{}) error
- func WithStack(err error) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
Errorf formats according to a format specifier and returns the string as a value that satisfies error. Errorf also records the stack trace at the point it was called. just like fmt.Errorf()
func New ¶
New returns an error with the supplied message. New also records the stack trace at the point it was called. just like buildin errors.New()
func WithMessage ¶
WithMessage annotates err with a new message. If err is nil, WithMessage returns nil. extent err with more information but not break the origin error
func WithMessagef ¶
WithMessagef annotates err with the format specifier. extent err with more information but not break the origin error
func WithStack ¶
WithStack annotates err with a stack trace at the point WithStack was called. If err is nil, WithStack returns nil.
func Wrap ¶
Wrap returns an error annotating err with a stack trace at the point Wrap is called, and the supplied message. If err is nil, Wrap returns nil. always used in the boundary of thirdparty module, do not used thirdparty error directory but define a error (var GitError = errors.New("Git Error")) and Warp with the information of third party error info Wrap(GitError, error.Error())
Types ¶
This section is empty.