pub struct DoCatchBuilder { /* private fields */ }Expand description
Builder for a .do_catch_exception() / .do_catch_when() / .do_catch_all() clause.
Implementations§
Source§impl DoCatchBuilder
impl DoCatchBuilder
Sourcepub fn process(self, processor: BoxProcessor) -> Self
pub fn process(self, processor: BoxProcessor) -> Self
Add a step to the catch clause’s sub-pipeline.
Sourcepub fn on_when(self, predicate: FilterPredicate) -> Self
pub fn on_when(self, predicate: FilterPredicate) -> Self
Set an additional predicate that must also match for this catch clause to fire.
Sourcepub fn handled(self) -> Self
pub fn handled(self) -> Self
Mark this catch clause as handled: the caught error is absorbed and the clause’s exchange becomes the final result (no re-throw).
Only Handled and Propagate are supported. There is intentionally
no general disposition(value) setter, so Continued is
unrepresentable at the type level.
Valid use (compiles):
let _ = RouteBuilder::from("direct:start").route_id("x").do_try()
.do_catch_exception(&["E"])
.handled();Rejected — does not compile (no disposition method exists):
let b = RouteBuilder::from("direct:start").route_id("x").do_try()
.do_catch_exception(&["E"]);
b.disposition(ExceptionDisposition::Continued);Sourcepub fn propagate(self) -> Self
pub fn propagate(self) -> Self
Mark this catch clause as propagating: the clause runs for side-effects and the original error is re-thrown.
Only Handled and Propagate are supported. There is intentionally
no general disposition(value) setter, so Continued is
unrepresentable at the type level (semantically ambiguous at
catch-clause scope; .continued() is deliberately not provided).
Sourcepub fn end_do_catch(self) -> DoTryBuilder
pub fn end_do_catch(self) -> DoTryBuilder
Close the catch clause and return the parent DoTryBuilder.