Skip to main content

ExceptionHandler

Trait ExceptionHandler 

Source
pub trait ExceptionHandler: Send + Sync {
    // Required method
    fn handle_exception<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 Request,
        error: DispatchError,
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait for handling exceptions during request processing

Required Methods§

Source

fn handle_exception<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 Request, error: DispatchError, ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle an exception and convert it to a response

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§