Documentation ¶
Overview ¶
nolint:gomnd
Index ¶
- Constants
- func As(err error, target interface{}) bool
- func Code(err error) int
- func Errorf(code int, format string, a ...interface{}) error
- func Is(err, target error) bool
- func IsBadRequest(err error) bool
- func IsForbidden(err error) bool
- func IsInternalServer(err error) bool
- func IsNotFound(err error) bool
- func IsUnauthorized(err error) bool
- func Unwrap(err error) error
- type Error
- type IgnoreError
- type RespError
Constants ¶
View Source
const (
UnknownCode = 500
)
Variables ¶
This section is empty.
Functions ¶
func IsBadRequest ¶
func IsForbidden ¶
func IsInternalServer ¶
IsInternalServer determines if err is an error which indicates an Internal error. It supports wrapped errors.
func IsNotFound ¶
func IsUnauthorized ¶
Types ¶
type Error ¶
type Error struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
func BadRequest ¶
func InternalServer ¶
func Unauthorized ¶
func (Error) GetMessage ¶
func (Error) GetMetadata ¶
type IgnoreError ¶ added in v0.1.23
type IgnoreError interface {
Ignore() bool
}
Click to show internal directories.
Click to hide internal directories.