Skip to main content

Module error_layer

Module error_layer 

Source
Expand description

Centralized error mapping for Axum

Converts framework and gear errors into CanonicalError. Wire rendering (RFC 9457 application/problem+json), instance, and trace_id are attached by IntoResponse for CanonicalError plus the canonical_error_middleware (crate::api::canonical_error_layer).

Traits§

IntoCanonical
Helper trait for converting concrete error types into CanonicalError.

Functions§

error_mapping_middleware
Passthrough middleware kept for backwards compatibility with the api-gateway layer stack. The real work (logging diagnostic(), filling trace_id / instance) is now done by canonical_error_middleware.
extract_trace_id
Extract trace ID from headers or generate one
map_error_to_canonical
Centralized downcast-based error mapping.