Module tsukuyomi::error

source ·
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

A custom trait object which holds all kinds of errors occurring in handlers.
An error type which wraps a Displayable value.

Traits

A trait representing error values to be converted into an HTTP response.

Functions

Equivalent to custom(StatusCode::BAD_REQUEST, msg).
Equivalent to custom(StatusCode::FORBIDDEN, msg).
Equivalent to custom(StatusCode::INTERNAL_SERVER_ERROR, msg).
Equivalent to custom(StatusCode::METHOD_NOT_ALLOWED, msg).
Equivalent to custom(StatusCode::NOT_FOUND, msg).
Equivalent to custom(StatusCode::UNAUTHORIZED, msg).

Type Definitions

A type alias of Result<T, E> with error::Error as error type.