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§
Sourcefn handle(&self, exception: &TaskException) -> ExceptionAction
fn handle(&self, exception: &TaskException) -> ExceptionAction
Handle an exception and return the action to take
Provided Methods§
Sourcefn transform(&self, exception: TaskException) -> TaskException
fn transform(&self, exception: TaskException) -> TaskException
Transform an exception (e.g., add metadata, modify traceback)
Sourcefn on_exception(&self, _exception: &TaskException)
fn on_exception(&self, _exception: &TaskException)
Called before the exception is processed