On Fri, Nov 4, 2011 at 2:50 PM, ahiebl <[email protected]> wrote:
> 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
>

Yeah we should probably check for that property and store it in the
trace event message.

Fell free to create a JIRA ticket with this issue.
Link from here
http://camel.apache.org/support


>
>
> --
> 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.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to