[ 
https://issues.apache.org/jira/browse/CAMEL-22529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-22529:
--------------------------------
    Fix Version/s:     (was: 4.10.8)

> camel-core: onException doesn't work as expected
> ------------------------------------------------
>
>                 Key: CAMEL-22529
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22529
>             Project: Camel
>          Issue Type: Bug
>          Components: came-core
>    Affects Versions: 4.10.7
>            Reporter: Mike Kobler
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.14.3, 4.17.0
>
>
> When using a RouteConfigurationBuilder with multiple onException blocks, 
> Apache Camel incorrectly matches the thrown exception to the wrong handler.
> {code:java}
> public class Xyz extends RouteConfigurationBuilder {
>   @Override
>   public void configuration() throws Exception {
>     routeConfiguration()
>       .onException(HttpOperationFailedException.class)
>         .log(LoggingLevel.ERROR, "Test HttpOperationFailedException: 
> ${exception}")
>       .onException(Exception.class)
>         .log(LoggingLevel.ERROR, "Test Exception: ${exception}")
>       ;
>   }
> }{code}
> This example outputs "Test HttpOperationFailedException: java.lang.Exception" 
> when java.lang.Exception is thrown. Expected result would be "Test Exception: 
> java.lang.Exception"
> Am I doing something wrong or is this a bug?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to