ExceptionHandler

Trait ExceptionHandler 

Source
pub trait ExceptionHandler: Send + Sync {
    // Required method
    fn handle(&self, exception: &TaskException) -> ExceptionAction;

    // Provided methods
    fn transform(&self, exception: TaskException) -> TaskException { ... }
    fn on_exception(&self, _exception: &TaskException) { ... }
    fn name(&self) -> &'static str { ... }
}
Expand description

Trait for custom exception handlers

Required Methods§

Source

fn handle(&self, exception: &TaskException) -> ExceptionAction

Handle an exception and return the action to take

Provided Methods§

Source

fn transform(&self, exception: TaskException) -> TaskException

Transform an exception (e.g., add metadata, modify traceback)

Source

fn on_exception(&self, _exception: &TaskException)

Called before the exception is processed

Source

fn name(&self) -> &'static str

Get handler name for logging

Implementors§