Documentation ¶
Index ¶
- func Error(message string) error
- func Errorf(format string, args ...interface{}) error
- func HTTP(code int, err error, format string, args ...interface{}) error
- func HTTPCode(err error) int
- func HTTPCodeOnly(code int) error
- func HTTPWithError(code int, err error) error
- func HTTPWithMsg(code int, format string, args ...interface{}) error
- func Is(e1, e2 error) bool
- func IsRetryableError(err error) bool
- func New(message string) error
- func Wrap(err error, msg string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type Caller
- type CallerInfo
- type CustomError
- func (err CustomError) Cause() error
- func (err CustomError) Code() int
- func (err CustomError) Description() Description
- func (err CustomError) Error() string
- func (err CustomError) Format(s fmt.State, v rune)
- func (err CustomError) Formatted(opts FormattingOptions) string
- func (err CustomError) Is(specificError error) bool
- type Description
- type ErrorWithCause
- type ErrorWithIs
- type FormattingOptions
- type ICaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPCodeOnly ¶
func HTTPWithError ¶
func HTTPWithMsg ¶
func IsRetryableError ¶
Types ¶
type Caller ¶
type Caller struct {
// contains filtered or unexported fields
}
e.g.:
func (Caller) Info ¶
func (c Caller) Info() CallerInfo
func (Caller) Package ¶
with Function: "github.com/go-msvc/ms_test.TestCaller" return "github.com/go-msvc/ms_test"
func (Caller) PackageFile ¶
return "github.com/go-msvc/ms_test/my_test.go"
type CallerInfo ¶
type CallerInfo struct { Package string `json:"package"` File string `json:"file"` Line int `json:"line"` Function string `json:"function"` }
func Stack ¶
func Stack(skip int) []CallerInfo
type CustomError ¶
type CustomError struct {
// contains filtered or unexported fields
}
CustomError implements the following interfaces:
error github.com/pkg/errors: Cause
func (CustomError) Cause ¶
func (err CustomError) Cause() error
implement github.com/pkg/errors: Cause
func (CustomError) Code ¶
func (err CustomError) Code() int
func (CustomError) Description ¶
func (err CustomError) Description() Description
func (CustomError) Formatted ¶
func (err CustomError) Formatted(opts FormattingOptions) string
func (CustomError) Is ¶
func (err CustomError) Is(specificError error) bool
Is() compares the message string of this or any cause to match the specified error message
type Description ¶
type Description struct { Message string `json:"error"` Source *CallerInfo `json:"source,omitempty"` Cause *Description `json:"cause,omitempty"` }
type ErrorWithCause ¶
extends default golang error interface
type ErrorWithIs ¶
type FormattingOptions ¶
Click to show internal directories.
Click to hide internal directories.