Documentation ¶
Index ¶
- func Contains(a error, b error) (has bool)
- type CodeError
- func As(err error) (e CodeError, ok bool)
- func BadRequest(message string) CodeError
- func Decode(p []byte) (err CodeError)
- func Empty() CodeError
- func Forbidden(message string) CodeError
- func New(code int, name string, message string) CodeError
- func NewWithDepth(code int, name string, message string, skip int) CodeError
- func NilError() CodeError
- func NotAcceptable(message string) CodeError
- func NotFound(message string) CodeError
- func NotImplemented(message string) CodeError
- func ServiceError(message string) CodeError
- func Timeout(message string) CodeError
- func TooEarly(message string) CodeError
- func TooMayRequest(message string) CodeError
- func Unauthorized(message string) CodeError
- func Unavailable(message string) CodeError
- func Warning(message string) CodeError
- func Wrap(err error) (codeErr CodeError)
- type CodeErrorImpl
- func (e CodeErrorImpl) Code() int
- func (e CodeErrorImpl) Contains(err error) (has bool)
- func (e CodeErrorImpl) Error() string
- func (e CodeErrorImpl) Format(state fmt.State, verb rune)
- func (e CodeErrorImpl) Id() string
- func (e CodeErrorImpl) MarshalJSON() (p []byte, err error)
- func (e CodeErrorImpl) Message() string
- func (e CodeErrorImpl) Name() string
- func (e CodeErrorImpl) Stacktrace() (fn string, file string, line int)
- func (e CodeErrorImpl) String() string
- func (e CodeErrorImpl) WithCause(cause error) (err CodeError)
- func (e CodeErrorImpl) WithMeta(key string, value string) (err CodeError)
- type Errors
- type JoinedErrors
- type Meta
- type Pair
- type Stacktrace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodeError ¶
type CodeError interface { Id() string Code() int Name() string Message() string Stacktrace() (fn string, file string, line int) WithMeta(key string, value string) (err CodeError) WithCause(cause error) (err CodeError) Contains(err error) (has bool) Error() string Format(state fmt.State, r rune) String() string json.Marshaler }
func BadRequest ¶ added in v1.4.0
func NewWithDepth ¶ added in v1.3.0
func NotAcceptable ¶ added in v1.4.0
func NotImplemented ¶ added in v1.4.0
func ServiceError ¶
func TooMayRequest ¶ added in v1.13.6
func Unauthorized ¶ added in v1.4.0
func Unavailable ¶ added in v1.4.0
type CodeErrorImpl ¶ added in v1.13.12
type CodeErrorImpl struct { Id_ string `json:"id,omitempty" avro:"id"` Code_ int `json:"code,omitempty" avro:"code"` Name_ string `json:"name,omitempty" avro:"name"` Message_ string `json:"message,omitempty" avro:"message"` Meta_ Meta `json:"meta,omitempty" avro:"meta"` Stacktrace_ Stacktrace `json:"stacktrace,omitempty" avro:"stacktrace"` Cause_ *CodeErrorImpl `json:"cause,omitempty" avro:"cause"` }
func (CodeErrorImpl) Code ¶ added in v1.13.12
func (e CodeErrorImpl) Code() int
func (CodeErrorImpl) Contains ¶ added in v1.13.12
func (e CodeErrorImpl) Contains(err error) (has bool)
func (CodeErrorImpl) Error ¶ added in v1.13.12
func (e CodeErrorImpl) Error() string
func (CodeErrorImpl) Format ¶ added in v1.13.12
func (e CodeErrorImpl) Format(state fmt.State, verb rune)
func (CodeErrorImpl) Id ¶ added in v1.13.12
func (e CodeErrorImpl) Id() string
func (CodeErrorImpl) MarshalJSON ¶ added in v1.13.12
func (e CodeErrorImpl) MarshalJSON() (p []byte, err error)
func (CodeErrorImpl) Message ¶ added in v1.13.12
func (e CodeErrorImpl) Message() string
func (CodeErrorImpl) Name ¶ added in v1.13.12
func (e CodeErrorImpl) Name() string
func (CodeErrorImpl) Stacktrace ¶ added in v1.13.12
func (e CodeErrorImpl) Stacktrace() (fn string, file string, line int)
func (CodeErrorImpl) String ¶ added in v1.13.12
func (e CodeErrorImpl) String() string
func (CodeErrorImpl) WithCause ¶ added in v1.13.12
func (e CodeErrorImpl) WithCause(cause error) (err CodeError)
type Errors ¶ added in v1.13.0
type Errors []CodeError
func MakeErrors ¶ added in v1.13.0
func MakeErrors() Errors
type JoinedErrors ¶ added in v1.13.6
type JoinedErrors interface {
Unwrap() []error
}
type Pair ¶ added in v1.13.9
func (Pair) MarshalJSON ¶ added in v1.13.9
type Stacktrace ¶ added in v1.13.12
type Stacktrace struct { Fn string `json:"fn" avro:"fn"` File string `json:"file" avro:"file"` Line int `json:"line" avro:"line"` }
func (Stacktrace) MarshalJSON ¶ added in v1.13.12
func (s Stacktrace) MarshalJSON() (p []byte, err error)
Click to show internal directories.
Click to hide internal directories.