Versions in this module Expand all Collapse all v0 v0.0.2 Sep 11, 2020 v0.0.1 Jul 30, 2020 Changes in this version + var ErrNotImplemented = New(NotImplementedCause, "Not Implemented") + var InvalidArgumentCause = NewCause(BadRequestCategory, "invalid_argument") + var InvalidStateCause = NewCause(BadRequestCategory, "invalid_state") + var NotImplementedCause = NewCause(NotImplementedCategory, "not_implemented") + var ProgrammerErrorCause = NewCause(InternalServerErrorCategory, "programmer_error") + var TimeoutCause = NewCause(RequestTimeoutCategory, "timeout") + var UnknownCause = NewCause(InternalServerErrorCategory, "unknown_cause") + var UnsupportedErrorCause = NewCause(InternalServerErrorCategory, "unsupported_error") + func CausedBy(err error, c Cause) bool + func ErrorFromBytes(data []byte) error + func FromCause(e error, c Cause) bool + type Category string + var BadRequestCategory Category = "bad_request" + var ConflictCategory Category = "conflict" + var ForbiddenCategory Category = "forbidden" + var InternalServerErrorCategory Category = "internal_error" + var MethodNotAllowedCategory Category = "method_not_allowed" + var NotFoundCategory Category = "not_found" + var NotImplementedCategory Category = "not_implemented" + var RequestTimeoutCategory Category = "request_timeout" + var UnauthorizedCategory Category = "unauthorized" + func CategoryForStatusCode(code int) (Category, bool) + func (t Category) String() string + type Cause struct + Category Category + Name string + func NewCause(c Category, name string) Cause + type Error struct + Cause Cause + Messages []string + func New(c Cause, msg string, args ...interface{}) *Error + func NewMulti(c Cause, msgs []string, args ...interface{}) *Error + func ToError(e error) *Error + func Wrap(c Cause, err error) *Error + func WrapMulti(c Cause, errs []error) *Error + func (e *Error) Code() int32 + func (e *Error) Error() string + func (e *Error) StatusCode() int + func (e *Error) Validate(_ interface{}) error + type HTTPError interface + Code func() int32 + StatusCode func() int