[ 
https://issues.apache.org/activemq/browse/CAMEL-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-792.
-------------------------------

    Resolution: Fixed

Tomasz thanks for the patches. I have applied a fix based on your work. Also I 
fixed that for INFO logging it was logging at DEBUG level instead.

> Exception is not logged or handled when error handler is LoggingErrorHandler 
> and processing occurs inside Pipeline
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-792
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-792
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>         Environment: camel-core-1.4.0.0-fuse. windows xp, java 6
>            Reporter: Tomasz Domzal
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>         Attachments: camel-792-logging-error-handler-test-case.patch.txt, 
> camel-792-logging-error-handler.patch.txt, 
> ExceptionHandlingWithLoggingHanderAndPipelineTest.java
>
>
> Exception throw inside Pipeline is not reported or handled when error handler 
> is LoggingErrorHandler.
> Attached unit test fails - exchange with exception is not passed to 
> "mock:error" endpoints.
> Test will pass when you change error handler to default 
> (DeadLetterErrorHandler)
> or when processor throwing an exception is processed not inside Pipeline.
> After some digging inside source code I noticed Pipeline source code fragment.
> {code:java}
>     public void process(Exchange exchange) throws Exception {
>         AsyncProcessorHelper.process(this, exchange);
>     }
> {code}
> AsyncProcessorHelper.process(..) never throws exception directly.
> Instead it passes exception information in exchange object properties.
> Problem is LoggingErrorHandler doesn't use it correctly because (code snipped 
> from LoggingErrorHandler):
> {code:java}
>     public void process(Exchange exchange) throws Exception {
>         try {
>             output.process(exchange);
>         } catch (Throwable e) {
>             if (!customProcessorForException(exchange, e)) {
>                 logError(exchange, e);
>             }
>         }
>     }
> {code}
> it is logging only exception returned directly by output.process call.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to