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§
Sourcefn match_policy(&self, err: &CamelError) -> Option<PolicyId>
fn match_policy(&self, err: &CamelError) -> Option<PolicyId>
Match a policy for the given error. Called once before retry.
Sourcefn 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 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.
Sourcefn 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_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.
Sourcefn 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,
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".