Skip to main content

RouteErrorHandler

Trait RouteErrorHandler 

Source
pub trait RouteErrorHandler: Send + Sync {
    // Required methods
    fn match_policy(&self, err: &CamelError) -> Option<PolicyId>;
    fn retry_step<'life0, 'life1, 'async_trait>(
        &'life0 self,
        policy: Option<PolicyId>,
        step: &'life1 mut BoxProcessor,
        original: Exchange,
        error: CamelError,
    ) -> Pin<Box<dyn Future<Output = RetryOutcome> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn handle_step<'life0, 'async_trait>(
        &'life0 self,
        policy: Option<PolicyId>,
        exchange: Exchange,
        error: CamelError,
    ) -> Pin<Box<dyn Future<Output = Result<StepDisposition, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_boundary<'life0, 'async_trait>(
        &'life0 self,
        kind: BoundaryKind,
        exchange: Exchange,
        error: CamelError,
    ) -> Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Route-level error handler owning ALL error handling logic.

Single owner of DLC, retry, onException policies. Called from RouteChannelService (boundary errors) and run_steps (step errors).

Required Methods§

Source

fn match_policy(&self, err: &CamelError) -> Option<PolicyId>

Match a policy for the given error. Called once before retry.

Source

fn retry_step<'life0, 'life1, 'async_trait>( &'life0 self, policy: Option<PolicyId>, step: &'life1 mut BoxProcessor, original: Exchange, error: CamelError, ) -> Pin<Box<dyn Future<Output = RetryOutcome> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Phase 1: Retry the failed step.

Source

fn handle_step<'life0, 'async_trait>( &'life0 self, policy: Option<PolicyId>, exchange: Exchange, error: CamelError, ) -> Pin<Box<dyn Future<Output = Result<StepDisposition, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Phase 2: Determine step disposition after retry exhaustion.

Source

fn handle_boundary<'life0, 'async_trait>( &'life0 self, kind: BoundaryKind, exchange: Exchange, error: CamelError, ) -> Pin<Box<dyn Future<Output = Result<Exchange, CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle boundary (infrastructure) errors.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§