[
https://issues.apache.org/jira/browse/CAMEL-21079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873436#comment-17873436
]
Claus Ibsen commented on CAMEL-21079:
-------------------------------------
Can you attach some sample route code / test that shows better what you do
> onException().doTry() is confused by prior exceptions
> -----------------------------------------------------
>
> Key: CAMEL-21079
> URL: https://issues.apache.org/jira/browse/CAMEL-21079
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 3.22.2
> Environment: Win 11 or RHEL 8
> Reporter: Petr Kuzel
> Priority: Minor
> Labels: error-handling
>
> I have observed following, if an exchange carries
> an exception, like in the onException() block, then:
> .log(...)
> .doTry()
> .removeProperty(...)
> behaves very differently from:
> // .log(...)
> .doTry()
> .removeProperty(...)
> If the exchange carries an exception, then with log(),
> the doTry() block body executes. Without log(),
> the doTry() block body does not execute.
> I'd expect that doTry() should not consider the prior exception
> but it should rather consider only exceptions thrown
> in the doTry() block itself, like the regular Java try block.
>
> (A check at the mailing list if it was a design intent has been inconclusive
> so following common sense and classifying as a bug.)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)