Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrorRetriable = errors.New("retryable error")
)
Functions ¶
func Is ¶
Is checks if the given error is the same as the target error It is a wrapper around errors.Is
func IsRetryable ¶
IsRetryable checks if the given error is a retryable error
func NewRetryableError ¶
NewRetryableError wraps the given error with a retryable error
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error indicates an error with more features like metedata
func New ¶
New returns an error that formats as the given text. Each call to New returns a distinct error value even if the text is identical.
func WithStack ¶
WithStack annotates err with a stack trace at the point WithStack is called, and returns the result. 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.
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 (Error) Format ¶
Format implements fmt.Formatter. It supports the formats %+v, %v, %s and %q. %+v prints the error message and the stack trace. %v and %s print the error message. %q prints the error message in quotes.
func (Error) Metadata ¶
MetaData returns copy of error metadata . Since it is copied no trace issue needs to be worried about
func (Error) MetadataString ¶
MetadataString returns the metadata as a string if there is no metadata it returns an empty string if there is metadata it returns a string with the format key1: value1,key2: value2, ...