You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Alfred Hiebl (Created) (JIRA)" <ji...@apache.org> on 2011/11/07 12:21:51 UTC
[jira] [Created] (CAMEL-4636) Tracing of exceptions
Tracing of exceptions
---------------------
Key: CAMEL-4636
URL: https://issues.apache.org/jira/browse/CAMEL-4636
Project: Camel
Issue Type: Improvement
Components: camel-core
Affects Versions: 2.6.0
Reporter: Alfred Hiebl
When a bean in a traced route throws an exception (e.g. NullPointerException) one would expect to see that in the causedByException property of the DefaultTraceEventMessage. But the exception is null.
The reason is that in DefaultTraceEventMessage the causedByException is set to exchange.getException(), at a time where it is already handled. The exception is still available as property Exchange.EXCEPTION_CAUGHT.
Suggestion for change:
{code}
public DefaultTraceEventMessage(final Date timestamp, final ProcessorDefinition<?> toNode, final Exchange exchange) {
this.tracedExchange = exchange;
...
this.causedByException = exchange.getException() != null ? exchange.getException().toString()
: extractExceptionCaught(exchange);
}
// used to set causedByException in cases where the exception is already handled
private static String extractExceptionCaught(Exchange exchange) {
Exception exceptionCaught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
return (exceptionCaught != null ? exceptionCaught.toString() : null);
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-4636) Tracing of exceptions
Posted by "Alfred Hiebl (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145348#comment-13145348 ]
Alfred Hiebl commented on CAMEL-4636:
-------------------------------------
See also Camel-Users thread http://camel.465427.n5.nabble.com/Tracing-exceptions-td4964120.html
> Tracing of exceptions
> ---------------------
>
> Key: CAMEL-4636
> URL: https://issues.apache.org/jira/browse/CAMEL-4636
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Alfred Hiebl
>
> When a bean in a traced route throws an exception (e.g. NullPointerException) one would expect to see that in the causedByException property of the DefaultTraceEventMessage. But the exception is null.
> The reason is that in DefaultTraceEventMessage the causedByException is set to exchange.getException(), at a time where it is already handled. The exception is still available as property Exchange.EXCEPTION_CAUGHT.
> Suggestion for change:
> {code}
> public DefaultTraceEventMessage(final Date timestamp, final ProcessorDefinition<?> toNode, final Exchange exchange) {
> this.tracedExchange = exchange;
> ...
> this.causedByException = exchange.getException() != null ? exchange.getException().toString()
> : extractExceptionCaught(exchange);
> }
>
> // used to set causedByException in cases where the exception is already handled
> private static String extractExceptionCaught(Exchange exchange) {
> Exception exceptionCaught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
> return (exceptionCaught != null ? exceptionCaught.toString() : null);
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-4636) Tracing of exceptions
Posted by "Daniel Kulp (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp updated CAMEL-4636:
-------------------------------
Fix Version/s: 2.8.3
> Tracing of exceptions
> ---------------------
>
> Key: CAMEL-4636
> URL: https://issues.apache.org/jira/browse/CAMEL-4636
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Alfred Hiebl
> Assignee: Claus Ibsen
> Fix For: 2.8.3, 2.9.0
>
>
> When a bean in a traced route throws an exception (e.g. NullPointerException) one would expect to see that in the causedByException property of the DefaultTraceEventMessage. But the exception is null.
> The reason is that in DefaultTraceEventMessage the causedByException is set to exchange.getException(), at a time where it is already handled. The exception is still available as property Exchange.EXCEPTION_CAUGHT.
> Suggestion for change:
> {code}
> public DefaultTraceEventMessage(final Date timestamp, final ProcessorDefinition<?> toNode, final Exchange exchange) {
> this.tracedExchange = exchange;
> ...
> this.causedByException = exchange.getException() != null ? exchange.getException().toString()
> : extractExceptionCaught(exchange);
> }
>
> // used to set causedByException in cases where the exception is already handled
> private static String extractExceptionCaught(Exchange exchange) {
> Exception exceptionCaught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
> return (exceptionCaught != null ? exceptionCaught.toString() : null);
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-4636) Tracing of exceptions
Posted by "Claus Ibsen (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-4636:
----------------------------------
Assignee: Claus Ibsen
> Tracing of exceptions
> ---------------------
>
> Key: CAMEL-4636
> URL: https://issues.apache.org/jira/browse/CAMEL-4636
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Alfred Hiebl
> Assignee: Claus Ibsen
>
> When a bean in a traced route throws an exception (e.g. NullPointerException) one would expect to see that in the causedByException property of the DefaultTraceEventMessage. But the exception is null.
> The reason is that in DefaultTraceEventMessage the causedByException is set to exchange.getException(), at a time where it is already handled. The exception is still available as property Exchange.EXCEPTION_CAUGHT.
> Suggestion for change:
> {code}
> public DefaultTraceEventMessage(final Date timestamp, final ProcessorDefinition<?> toNode, final Exchange exchange) {
> this.tracedExchange = exchange;
> ...
> this.causedByException = exchange.getException() != null ? exchange.getException().toString()
> : extractExceptionCaught(exchange);
> }
>
> // used to set causedByException in cases where the exception is already handled
> private static String extractExceptionCaught(Exchange exchange) {
> Exception exceptionCaught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
> return (exceptionCaught != null ? exceptionCaught.toString() : null);
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-4636) Tracing of exceptions
Posted by "Claus Ibsen (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-4636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-4636.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.9.0
> Tracing of exceptions
> ---------------------
>
> Key: CAMEL-4636
> URL: https://issues.apache.org/jira/browse/CAMEL-4636
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Alfred Hiebl
> Assignee: Claus Ibsen
> Fix For: 2.9.0
>
>
> When a bean in a traced route throws an exception (e.g. NullPointerException) one would expect to see that in the causedByException property of the DefaultTraceEventMessage. But the exception is null.
> The reason is that in DefaultTraceEventMessage the causedByException is set to exchange.getException(), at a time where it is already handled. The exception is still available as property Exchange.EXCEPTION_CAUGHT.
> Suggestion for change:
> {code}
> public DefaultTraceEventMessage(final Date timestamp, final ProcessorDefinition<?> toNode, final Exchange exchange) {
> this.tracedExchange = exchange;
> ...
> this.causedByException = exchange.getException() != null ? exchange.getException().toString()
> : extractExceptionCaught(exchange);
> }
>
> // used to set causedByException in cases where the exception is already handled
> private static String extractExceptionCaught(Exchange exchange) {
> Exception exceptionCaught = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
> return (exceptionCaught != null ? exceptionCaught.toString() : null);
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira