Documentation ¶
Index ¶
- func As(err error, target interface{}) bool
- func InvalidErrorCode(code string) bool
- func Is(err, target error) bool
- func Unwrap(err error) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- func Zero(e DetailError) bool
- type DetailError
- func Cause(cause error) DetailError
- func Causef(format string, args ...interface{}) DetailError
- func Causewf(err error, format string, args ...interface{}) DetailError
- func Code(code string) DetailError
- func Errorf(format string, args ...interface{}) DetailError
- func Msg(msg string) DetailError
- func New(causeStr string) DetailError
- func NewDetailError(code string, message string, cause error) DetailError
- type ErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidErrorCode ¶
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.
func Wrapf ¶
Wrapf returns an error annotating err with a stack trace at the point Wrapf is called, and the format specifier. If err is nil, Wrapf returns nil.
func Zero ¶ added in v0.2.1
func Zero(e DetailError) bool
Types ¶
type DetailError ¶
type DetailError interface { error fmt.Formatter GetCode() string GetMsg() string GetCause() error GetErrorCode() ErrorCode Code(code string) DetailError Msg(msg string) DetailError Cause(err error) DetailError Causef(format string, args ...interface{}) DetailError Causewf(err error, format string, args ...interface{}) DetailError ErrorCode(errorCode ErrorCode) DetailError }
func Cause ¶
func Cause(cause error) DetailError
func Causef ¶ added in v0.2.2
func Causef(format string, args ...interface{}) DetailError
func Causewf ¶ added in v0.2.3
func Causewf(err error, format string, args ...interface{}) DetailError
func Code ¶ added in v0.2.1
func Code(code string) DetailError
func Errorf ¶
func Errorf(format string, args ...interface{}) DetailError
func Msg ¶
func Msg(msg string) DetailError
func New ¶
func New(causeStr string) DetailError
New returns an error with the supplied message. New also records the stack trace at the point it was called.
func NewDetailError ¶
func NewDetailError(code string, message string, cause error) DetailError
type ErrorCode ¶
type ErrorCode interface { error fmt.Formatter GetCode() string GetMsg() string Code(code string) ErrorCode Msg(msg string) ErrorCode Cause(err error) DetailError Causef(format string, args ...interface{}) DetailError Causewf(err error, format string, args ...interface{}) DetailError }
func NewErrorCode ¶
Click to show internal directories.
Click to hide internal directories.