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