Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UnsupportedErrorCause = NewCause(InternalServerErrorCategory, "unsupported_error") UnknownCause = NewCause(InternalServerErrorCategory, "unknown_cause") ProgrammerErrorCause = NewCause(InternalServerErrorCategory, "programmer_error") InvalidArgumentCause = NewCause(BadRequestCategory, "invalid_argument") InvalidStateCause = NewCause(BadRequestCategory, "invalid_state") TimeoutCause = NewCause(RequestTimeoutCategory, "timeout") NotImplementedCause = NewCause(NotImplementedCategory, "not_implemented") )
List of all possible causes
View Source
var (
ErrNotImplemented = New(NotImplementedCause, "Not Implemented")
)
Functions ¶
func ErrorFromBytes ¶
Types ¶
type Category ¶
type Category string
Category is a category of cause
var ( BadRequestCategory Category = "bad_request" NotFoundCategory Category = "not_found" InternalServerErrorCategory Category = "internal_error" NotImplementedCategory Category = "not_implemented" MethodNotAllowedCategory Category = "method_not_allowed" ConflictCategory Category = "conflict" ForbiddenCategory Category = "forbidden" RequestTimeoutCategory Category = "request_timeout" )
List of all error categories
func CategoryForStatusCode ¶
CategoryForStatusCode convert an http status code to a category
type Error ¶
Error represents an Error returned by a middleware or route handler to a requestor.
Completes the HTTPError interface ¶
The ID may or may not be a NullID depending on the source of the error - if its unmarshaled from the old error format then it will be a NullID. Error is an error
func ToError ¶
ToError mutates a given error into an *Error, if the error is not a *Error then it mutates it into an InternalServerError with a corresponding message.
func (*Error) StatusCode ¶
StatusCode returns the HTTP Status Code associated with this Error
Click to show internal directories.
Click to hide internal directories.