Skip to main content

Module error

Module error 

Source
Expand description

HTTP error domain.

HttpError is the open trait every domain error implements; HttpException is the type-erased box that handlers actually return. The framework’s stock errors (NotFound, Unauthorized, BadRequest, Validation, ServiceUnavailable, Conflict, TooManyRequests, Internal) all implement HttpError and gain From<…> for HttpException automatically, so handlers compose with ? regardless of which concrete error variant they construct.

Structs§

BadRequest
Conflict
FieldError
Forbidden
GatewayTimeout
HttpException
Boxed HttpError. Handlers return Result<T, HttpException>; ? works across any user-defined error via the blanket From<E: HttpError> impl.
Internal
NotFound
ProblemDetails
ServiceUnavailable
TooManyRequests
Unauthorized
Validation

Enums§

Error

Traits§

HttpError
Every domain error type implements HttpError. The framework converts to a ProblemDetails body and the appropriate status code.