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§
- Into
Canonical - 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(), fillingtrace_id/instance) is now done bycanonical_error_middleware. - extract_
trace_ id - Extract trace ID from headers or generate one
- map_
error_ to_ canonical - Centralized downcast-based error mapping.