Documentation
¶
Index ¶
- func Errorf(msg string, args ...interface{}) error
- func GetStackTrace(err error) string
- func GetUserMessage(err error) string
- func UserErrorf(msg string, args ...interface{}) error
- func UserWrapf(err error, msg string, args ...interface{}) error
- func Wrapf(err error, msg string, args ...interface{}) error
- type ErrorType
- func (errorType ErrorType) Errorf(msg string, args ...interface{}) error
- func (errorType ErrorType) Set(err error) error
- func (errorType ErrorType) UserErrorf(msg string, args ...interface{}) error
- func (errorType ErrorType) UserWrapf(err error, msg string, args ...interface{}) error
- func (errorType ErrorType) Wrapf(err error, msg string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStackTrace ¶
GetStackTrace returns the stack trace starting from the first error that has been wrapped / created
func GetUserMessage ¶
GetUserMessage returns user readable error message for all errors If error is not `userMessager` returns empty string
func UserErrorf ¶
UserErrorf returns an error with format string
Types ¶
type ErrorType ¶
type ErrorType uint
ErrorType is the type of an error
const ( // NoType error - Default placeholder for un-typed errors NoType ErrorType = iota // BadRequest error - Code 400 BadRequest ErrorType = http.StatusBadRequest Unauthorized ErrorType = http.StatusUnauthorized // PaymentRequired error - Code 402 PaymentRequired ErrorType = http.StatusPaymentRequired // Forbidden error - Code 403 Forbidden ErrorType = http.StatusForbidden // NotFound error - Code 404 NotFound ErrorType = http.StatusNotFound // MethodNotAllowed error - Code 405 MethodNotAllowed ErrorType = http.StatusMethodNotAllowed // NotAcceptable error - Code 406 NotAcceptable ErrorType = http.StatusNotAcceptable // ProxyAuthRequired error - Code 407 ProxyAuthRequired ErrorType = http.StatusProxyAuthRequired // RequestTimeout error - Code 408 RequestTimeout ErrorType = http.StatusRequestTimeout // Conflict error - Code 409 Conflict ErrorType = http.StatusConflict // Gone error - Code 410 Gone ErrorType = http.StatusGone // LengthRequired error - Code 411 LengthRequired ErrorType = http.StatusLengthRequired // PreconditionFailed error - Code 412 PreconditionFailed ErrorType = http.StatusPreconditionFailed // RequestEntityTooLarge error - Code 413 RequestEntityTooLarge ErrorType = http.StatusRequestEntityTooLarge // RequestURITooLong error - Code 414 RequestURITooLong ErrorType = http.StatusRequestURITooLong // UnsupportedMediaType error - Code 415 UnsupportedMediaType ErrorType = http.StatusUnsupportedMediaType // RequestedRangeNotSatisfiable error - Code 416 RequestedRangeNotSatisfiable ErrorType = http.StatusRequestedRangeNotSatisfiable // ExpectationFailed error - Code 417 ExpectationFailed ErrorType = http.StatusExpectationFailed // Teapot error - Code 418 Teapot ErrorType = http.StatusTeapot // UnprocessableEntity error - Code 422 UnprocessableEntity ErrorType = http.StatusUnprocessableEntity // Locked error - Code 423 Locked ErrorType = http.StatusLocked // FailedDependency error - Code 424 FailedDependency ErrorType = http.StatusFailedDependency // UpgradeRequired error - Code 426 UpgradeRequired ErrorType = http.StatusUpgradeRequired // PreconditionRequired error - Code 428 PreconditionRequired ErrorType = http.StatusPreconditionRequired // TooManyRequests error - Code 429 TooManyRequests ErrorType = http.StatusTooManyRequests // RequestHeaderFieldsTooLarge error - Code 431 RequestHeaderFieldsTooLarge ErrorType = http.StatusRequestHeaderFieldsTooLarge UnavailableForLegalReasons ErrorType = http.StatusUnavailableForLegalReasons // InternalServerError error - Code 500 InternalServerError ErrorType = http.StatusInternalServerError // NotImplemented error - Code 501 NotImplemented ErrorType = http.StatusNotImplemented // BadGateway error - Code 502 BadGateway ErrorType = http.StatusBadGateway ServiceUnavailable ErrorType = http.StatusServiceUnavailable // GatewayTimeout error - Code 504 GatewayTimeout ErrorType = http.StatusGatewayTimeout // HTTPVersionNotSupported error - Code 505 HTTPVersionNotSupported ErrorType = http.StatusHTTPVersionNotSupported // VariantAlsoNegotiates error - Code 506 VariantAlsoNegotiates ErrorType = http.StatusVariantAlsoNegotiates // InsufficientStorage error - Code 507 InsufficientStorage ErrorType = http.StatusInsufficientStorage // LoopDetected error - Code 508 LoopDetected ErrorType = http.StatusLoopDetected // NotExtended error - Code 510 NotExtended ErrorType = http.StatusNotExtended // NetworkAuthenticationRequired error - Code 511 NetworkAuthenticationRequired ErrorType = http.StatusNetworkAuthenticationRequired )
func GetType ¶
GetType returns the error type for all errors if error is not `typed` - it returns NoType
func (ErrorType) UserErrorf ¶
UserErrorf creates a new error with a user message
Click to show internal directories.
Click to hide internal directories.