Documentation
¶
Index ¶
- type Kind
- type Op
- type RichError
- func (e *RichError) Error() string
- func (e *RichError) Kind() Kind
- func (e *RichError) Message() string
- func (e *RichError) Meta() map[string]interface{}
- func (e *RichError) Op() Op
- func (e *RichError) ToJSON() (string, error)
- func (e *RichError) WithErr(err error) *RichError
- func (e *RichError) WithKind(kind Kind) *RichError
- func (e *RichError) WithMessage(message string) *RichError
- func (e *RichError) WithMeta(meta map[string]interface{}) *RichError
- func (e *RichError) WrappedError() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
const ( KindUnknown Kind = iota KindStatusContinue KindStatusSwitchingProtocols KindStatusProcessing KindStatusEarlyHints KindStatusOK KindStatusCreated KindStatusAccepted KindStatusNonAuthoritativeInfo KindStatusNoContent KindStatusResetContent KindStatusPartialContent KindStatusMultiStatus KindStatusAlreadyReported KindStatusIMUsed KindStatusMultipleChoices KindStatusMovedPermanently KindStatusFound KindStatusSeeOther KindStatusNotModified KindStatusUseProxy KindUnderscore // Kind_ KindStatusTemporaryRedirect KindStatusPermanentRedirect KindStatusBadRequest KindStatusPaymentRequired KindStatusForbidden KindStatusNotFound KindStatusMethodNotAllowed KindStatusNotAcceptable KindStatusProxyAuthRequired KindStatusRequestTimeout KindStatusConflict KindStatusGone KindStatusRequestedRangeNotSatisfiable KindStatusExpectationFailed KindStatusTeapot KindStatusMisdirectedRequest KindStatusUnprocessableEntity KindStatusLocked KindStatusFailedDependency KindStatusTooEarly KindStatusUpgradeRequired KindStatusPreconditionRequired KindStatusTooManyRequests KindStatusRequestHeaderFieldsTooLarge KindStatusInternalServerError KindStatusNotImplemented KindStatusBadGateway KindStatusGatewayTimeout KindStatusHTTPVersionNotSupported KindStatusVariantAlsoNegotiates KindStatusInsufficientStorage KindStatusLoopDetected KindStatusNotExtended KindStatusNetworkAuthenticationRequired )
type RichError ¶
type RichError struct {
// contains filtered or unexported fields
}
RichError is the main implementation of the RichErrorInterface.
func (*RichError) Kind ¶
Kind returns the kind of the error. It checks wrapped errors recursively if the kind is not set.
func (*RichError) Message ¶
Message returns the error message. It falls back to wrapped errors recursively if no message is set.
func (*RichError) Op ¶
Op returns the operation where the error occurred. It tries to fetch the operation from wrapped errors if not set.
func (*RichError) WithMessage ¶
WithMessage sets the error message.
func (*RichError) WithMeta ¶
WithMeta adds metadata to the error. func (e *RichError) WithMeta(key string, value interface{}) *RichError {
func (*RichError) WrappedError ¶
WrappedError returns the wrapped error.
Click to show internal directories.
Click to hide internal directories.