pub trait ErrorMapper: Clone + Send + 'static {
    fn map_error<'async_trait>(
        self,
        error: BoxError,
        request_id: Option<RequestId>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Body>, BoxError>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; }
Expand description

A trait for mapping authentication errors to HTTP responses.

Ideally, this would be a Tower service (Request=BoxError, Response=Response<Body>), but the Rust compiler currently has issues with this.

Required Methods§

Attempt to map the error to an HTTP response.

Implementors§