camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadrian Zbarcea (JIRA)" <>
Subject [jira] [Commented] (CAMEL-4022) Issue using errorBuilderRef with the xml dsl
Date Tue, 07 Jun 2011 02:52:59 GMT


Hadrian Zbarcea commented on CAMEL-4022:

@Claus, I agree a full test is absolutely necessary before committing.

FWIW, I know this ErrorHandler is only used with OnException, i.e. when onException is used
in the DSL. Naming the handler OnExceptionErrorHandler will therefore relate to the route
building syntax, not the semantics which to me is a problem. I trust you'll be able to come
with something better.

Couple of comments on the patch: the error handler could be a singleton (obviously stateless).
I think logging should be at error level. To your comment in the code, I don't think anything
related to this error handler should be configurable.

That said, it's definitely a step in the right direction. Feel free to commit the patch. We
can follow up with more changes once we agree on the other details and then close the issue

> Issue using errorBuilderRef with the xml dsl
> --------------------------------------------
>                 Key: CAMEL-4022
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.7.1
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>            Priority: Critical
>         Attachments: onexceptionerrorhandler.patch
> While fixing issues around the errorHandler I noticed that <onException> definitions
defined in the camel context are ignored if a route specifies its own errorHandlerRef. The
reason is that we set the onException definition on the default error handler. I have a fix
for that, but I discovered a different issue (I think) for which I would like to discuss the
> When we have an onException definition that looks kinda like this:
> {code}
> <onException>
>   <exception> java.lang.IllegalArgumentException</exception>
>   <to uri="mock:illegalArgumentException"/>
> </onException>
> {code}
> ... something happens, the IAE exception is caught, we do something, but in that process
another exception is thrown. Currently, that would be caught by the default error handler,
which may not be what we want.
> What error handler (if any) should handle exceptions thrown while in onException?
> The onException mechanism is somewhat similar to a try/catch. I don't think the exceptions
thrown while handling onException should be handled by the same error handler configured for
the route, or even the context scoped one. The processing should be very simple, predictable
and immutable. Since the default "CamelDefaultErrorHandlerBuilder" can be replaced, it is
not imho a solution and we need one global one that does as little as possible (the problem
would be agreeing what that is: no redeliveries, logging or not, etc).
> Thoughts?

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message