Documentation ¶
Index ¶
- Constants
- Variables
- func AddDetails(err error, d errorutil.Details) error
- func IgnoreError(err error) (ignore bool)
- func IsAPIError(err error) bool
- func IsKind(err error, kind Kind) bool
- func NewBadRequest(msg string) error
- func NewDataRace(msg string) error
- func NewForbidden(msg string) error
- func NewInternalError(msg string) error
- func NewInvalid(msg string) error
- func NewNotFound(msg string) error
- func NewTooManyRequest(msg string) error
- func NewUnauthorized(msg string) error
- type APIError
- type Cause
- type Details
- type Kind
- func (k Kind) Errorf(format string, args ...interface{}) error
- func (k Kind) New(msg string) error
- func (k Kind) NewWithCause(msg string, c Cause) error
- func (k Kind) NewWithCauses(msg string, cs []Cause) error
- func (k Kind) NewWithDetails(msg string, details Details) error
- func (k Kind) NewWithInfo(msg string, info Details) error
- func (k Kind) Wrap(err error, msg string) error
- type MapCause
- type Name
- type SkipLoggingHook
- type StringCause
Constants ¶
View Source
const ( APIErrorDetail errorutil.DetailTag = "api" TenantDetail errorutil.DetailTag = "tenant" )
Variables ¶
View Source
var SkipLoggingForKinds map[Kind]bool
View Source
var ValidationFailed = Invalid.WithReason("ValidationFailed")
Functions ¶
func IgnoreError ¶
func IsAPIError ¶
func NewBadRequest ¶
func NewDataRace ¶
func NewForbidden ¶
func NewInternalError ¶
func NewInvalid ¶
func NewNotFound ¶
func NewTooManyRequest ¶
func NewUnauthorized ¶
Types ¶
type APIError ¶
type APIError struct { Kind Message string `json:"message"` Code int `json:"code"` Info map[string]interface{} `json:"info,omitempty"` }
func AsAPIError ¶
type MapCause ¶
func (MapCause) MarshalJSON ¶
type Name ¶
type Name string
const ( BadRequest Name = "BadRequest" Invalid Name = "Invalid" Forbidden Name = "Forbidden" NotFound Name = "NotFound" AlreadyExists Name = "AlreadyExists" DataRace Name = "DataRace" TooManyRequest Name = "TooManyRequest" InternalError Name = "InternalError" RequestEntityTooLarge Name = "RequestEntityTooLarge" )
func (Name) HTTPStatus ¶
func (Name) WithReason ¶
type SkipLoggingHook ¶
type SkipLoggingHook struct{}
func (SkipLoggingHook) Levels ¶
func (SkipLoggingHook) Levels() []logrus.Level
type StringCause ¶
type StringCause string
func (StringCause) Kind ¶
func (c StringCause) Kind() string
func (StringCause) MarshalJSON ¶
func (c StringCause) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.