camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-7071) Exchange.getException(Class<T> clazz) returns root cause instead of thrown exception
Date Wed, 18 Dec 2013 06:37:07 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-7071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13851427#comment-13851427
] 

Willem Jiang commented on CAMEL-7071:
-------------------------------------

As an application developer, you can just use Exchange.getException() to access the exception.

> Exchange.getException(Class<T> clazz) returns root cause instead of thrown exception
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-7071
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7071
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.12.2
>            Reporter: Mariusz Lotko
>            Assignee: Willem Jiang
>
> If I catch SQLException and wrap it in new MyCoolBuisinessException, then Exchange.getException()
returns MyCoolBusinessException, but Exchange.getException(Exception.class) returns SQLException.
> This impacts ExchangeException annotation which calls Exchange.getException(Exception.class).
> Reason for that is in constructor of ObjectUtils.ExceptionIterator which for some reason
calls Collections.reverse(tree).



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message