camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahiebl <a.hi...@mic-cust.com>
Subject Tracing exceptions
Date Fri, 04 Nov 2011 13:50:34 GMT
Hi,

we add a tracer to our camel context that logs to a JPA table, i.e.
tracer.setUseJpa(true);
This works fine. 

But when a bean in the traced route throws an exception (e.g.
NullPointerException) I would actually expect to see that in the
causedByException property. But the exception is null.

I think the reason is that in DefaultTraceEventMessage the causedByException
is set to exchange.getException, maybe at a time where it is already
handled. The exception is still available as property
Exchange.CAUSED_BY_EXCEPTION, though.

public DefaultTraceEventMessage(final Date timestamp, final
ProcessorDefinition<?> toNode, final Exchange exchange) {
        this.tracedExchange = exchange;
        ...
        this.causedByException = exchange.getException() != null ?
exchange.getException().toString() : null;
}

Is this a bug or is there another way to get that exception traced. This
would be really helpful for debugging purposes.

Many thanks,
Alfred

PS: Using Camel 2.6



--
View this message in context: http://camel.465427.n5.nabble.com/Tracing-exceptions-tp4964120p4964120.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message