[ 
https://issues.apache.org/jira/browse/CAMEL-4022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044876#comment-13044876
 ] 

Hadrian Zbarcea commented on CAMEL-4022:
----------------------------------------

Claus, I can understand how you got confused. I should have been clearer in the 
description above. This shouldn't be a duplicate of CAMEL-3989, as I said in 
the description above: "I discovered a different issue". And the problem, 
although I discovered while looking into the camel-spring issue is in 
camel-core. Anyway, the title and description are not clear, I agree with that.

Regarding your comment above, yes, my test targeted the java dsl, to resolve 
the part of the issue that became CAMEL-4041 on Thu, one day later.

I don't think it's worth getting pedantic and cleanup the description and title 
of this issue (feel free if you think it's important). I would however continue 
the discussion for CAMEL-4041 here, because we have the context here (unless we 
copy a couple of the relevant comments there).

To the not very important issue of naming, I think OnExceptionErrorHandler is 
much less descriptive than FatalErrorHandler, which may not be the best name 
either. More descriptive would be ExceptionWhileHandlingExceptionErrorHandler, 
which to me sounded like Fatal.

To the proposed issues of having it configurable, I am strongly against it 
being configurable. This is a fatal situation that should not occur in the 
first place. If the exception should be ignored, again no, I believe Johan said 
the same thing. This is a situation much more likely to appear during 
development (in production it would be only the result of insufficient 
testing). We should fail fast and loud. So the only viable solution to me is 
c), something like an 'internal server error'. There are other solutions to be 
considered, like stopping the route, but given the stateless nature of camel 
routes I don't think we should go that far.


> Issue using errorBuilderRef with the xml dsl
> --------------------------------------------
>
>                 Key: CAMEL-4022
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4022
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.7.1
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>            Priority: Critical
>
> 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 solution.
> 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: http://www.atlassian.com/software/jira

Reply via email to