Skip to main content

Module error

Module error 

Source
Expand description

Entry-local HTTP error type for non-OAuth API routes.

Handlers return Result<_, ApiHttpError> and propagate domain, repository, and service errors with ?. The variant-to-HTTP-status mapping lives once, in the conversions submodule’s From impls, so domain/* never references the HTTP envelope and the boundary decides the status code from the error variant rather than at each call site.

The wire shape is the shared ApiError JSON envelope; ApiHttpError is a thin entry-local newtype whose only reason to exist is the orphan rule — impl From<DomainError> for ApiError is forbidden in this crate (both types are foreign), so a local target type is required to obtain bare ?. into_response delegates to ApiError, which logs exactly once by status class.

Structs§

ApiHttpError