[
https://issues.apache.org/jira/browse/CAMEL-20770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17846606#comment-17846606
]
Claus Ibsen commented on CAMEL-20770:
-------------------------------------
Camel only catches Exception to let serious errors like OOME and others be
handed by the JVM as they should be.
There is a JIRA somewhere about this
> onException(Throwable.class) does not catch java.lang.AssertionError
> --------------------------------------------------------------------
>
> Key: CAMEL-20770
> URL: https://issues.apache.org/jira/browse/CAMEL-20770
> Project: Camel
> Issue Type: Bug
> Components: came-core
> Affects Versions: 4.4.0
> Reporter: John Yin
> Priority: Major
>
> The onException(Throwable.class) does not catch java.lang.AssertionError in
> 4.4.0. It worked fine in 3.18.x.
> Here is a sample:
> {code:java}
> from("timer://test?repeatCount=1")
> .onException(Throwable.class).handled(true).log("in onException").end()
> .process({
> assert false : "test onException for assert"
> }) {code}
> The onException would not catch the assert failure and not print "in
> onException" in log. The onException can catch other exceptions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)