camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Whiteside (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-6406) Add support to ObjectHelper.getException() for Java 1.7 Throwable.getSuppressed()
Date Fri, 24 Oct 2014 16:51:34 GMT

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

Aaron Whiteside edited comment on CAMEL-6406 at 10/24/14 4:51 PM:
------------------------------------------------------------------

getSuppressed() is not the same thing as getCause(). Causes are chained, suppressed exceptions
are well suppressed.. 

Typically you would call exception.addSuppressed( x ); this happens automatically with a try-with-resource
block. Or more typically when you catch an exception and must close some resource who's close
method also throws an exception, gone are the days when you would ignore that nested exception,
now you can call addSuppressed() to the original exception.

http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)



was (Author: aaronjwhiteside):
getSuppressed() is not the same thing as getCause(). Causes are chained, suppressed exceptions
are well suppressed.. 

Typically you would call exception.addSuppressed( x ); this happens automatically with a try-with-resource
block. Or more typically when you catch an exception and must close some resource who's close
method also throws an exception, gone are the days when you would ignore that nested exception,
now you can call addSuppressed() to the original exception.



> Add support to ObjectHelper.getException() for Java 1.7 Throwable.getSuppressed()
> ---------------------------------------------------------------------------------
>
>                 Key: CAMEL-6406
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6406
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.11.0, 2.14.0
>            Reporter: Aaron Whiteside
>            Assignee: Willem Jiang
>
> Add support to ObjectHelper.getException() for Java 1.7 Throwable.getSuppressed()
> Now that exceptions can be suppressed in Java 1.7 Camel should be able to detect when
running in a 1.7 JVM and use the additional suppressed Throwables when searching for specific
exception types. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message