Skip to main content

ExceptionFilter

Trait ExceptionFilter 

Source
pub trait ExceptionFilter:
    Send
    + Sync
    + 'static {
    // Required method
    fn catch(
        &self,
        context: ExecutionContext,
        error: BootError,
    ) -> BoxFuture<'static, Result<Option<BootResponse>>>;
}
Expand description

Maps route/pipeline errors to HTTP responses.

Required Methods§

Source

fn catch( &self, context: ExecutionContext, error: BootError, ) -> BoxFuture<'static, Result<Option<BootResponse>>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, Fut> ExceptionFilter for F
where F: Fn(ExecutionContext, BootError) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Option<BootResponse>>> + Send + 'static,

Source§

impl<F> ExceptionFilter for CatchFilter<F>
where F: ExceptionFilter,