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§
Sourcefn 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,
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