Skip to main content

Module error

Module error 

Source
Expand description

Typed API errors for proper HTTP/gRPC status code mapping

Enums§

ApiError
API error types that can be downcast at the HTTP/gRPC boundary
AvailabilityError
Marker errors for availability endpoint failures. These are wrapped in anyhow::Error by the state implementation and downcasted in the Axum handlers to select the right HTTP status code.

Functions§

classify
Errors raised as AvailabilityError by a state implementation carry semantic meaning; anything else is a failure the client cannot act on. Both transports classify through here, so v1 and v2 cannot drift on what counts as a 404.
to_status
Render a handler error for the v2 transports: the gRPC grpc-message trailer and, via tonic_rest::RestError, the REST error body. Classification and the credential scrub happen in classify and ApiError’s Display, shared with the v1 path.