Expand description
Error representation during handling the request.
Tsukuyomi models the all errors generated during handling HTTP requests with a trait
named HttpError. This trait is a method for converting itself into an HTTP response.
The design of this trait imitates the failure crate, but there are some specialization
considering of the HTTP context.
Structs§
- Error
- A custom trait object which holds all kinds of errors occurring in handlers.
- Error
Response - An error type which wraps a
Displayable value.
Traits§
- Http
Error - A trait representing error values to be converted into an HTTP response.
Functions§
- bad_
request - Equivalent to
custom(StatusCode::BAD_REQUEST, msg). - custom
- error_
response - forbidden
- Equivalent to
custom(StatusCode::FORBIDDEN, msg). - internal_
server_ error - Equivalent to
custom(StatusCode::INTERNAL_SERVER_ERROR, msg). - method_
not_ allowed - Equivalent to
custom(StatusCode::METHOD_NOT_ALLOWED, msg). - not_
found - Equivalent to
custom(StatusCode::NOT_FOUND, msg). - unauthorized
- Equivalent to
custom(StatusCode::UNAUTHORIZED, msg).
Type Aliases§
- Result
- A type alias of
Result<T, E>witherror::Erroras error type.