On Fri, Sep 9, 2011 at 2:08 AM, Damian Harvey <damian.har...@aon.com> wrote:
> Thanks Claus. Good to know.
>

We will improve this in the future, such as Camel 3.0 where we can
refactor the initialization logic for the Java DSL.
http://camel.apache.org/camel-30-roadmap.html

>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: Friday, 9 September 2011 12:37 AM
> To: users@camel.apache.org
> Subject: Re: Exception from child route not caught in parent onException
>
> On Thu, Sep 8, 2011 at 4:03 AM, Damian Harvey <damian.har...@aon.com> wrote:
>> I have a route("parent route") with a global onException() method that 
>> contains an Error Processor(). I can see that this is hit when an error is 
>> generated from within this route.
>>
>> I have a route("child route") that has no onException(). It is called by the 
>> parent route. It throws an exception (eg. ExecException from exec  
>> endpoint). I would expect the exception to bubble up and be caught by the 
>> parent route. This does not happen.
>
>>
>> If I add a LoggingErrorHandler() to the parent route, I can see the error 
>> logged.
>> If I add the same onException() to the child route as is on the parent, I 
>> can see the exception being caught.
>>
>> Once the child route throws the exception is it no longer an exception but 
>> an error? Can the parent route's global onException() be used in the manner 
>> that I am attempting?
>>
>
> No the Java DSL does not support this. The configure method is scoped for the 
> routes that the configure method encounters.
>
> But since its just java code, you can invoke configure on the other route 
> builder, or add some other common metod and invoke that etc -
> sharedErrorHandler() etc.
>
>
>
>> Thanks,
>>
>> Damian.
>>
>>
>> ________________________________
>>
>> This communication (and any attachments) is directed in confidence to the 
>> addressee(s) listed above, and may not otherwise be distributed, copied or 
>> used. The contents of this communication may also be subject to privilege, 
>> and all rights to that privilege are expressly claimed and not waived. If 
>> you have received this communication in error, please notify us by reply 
>> e-mail or by telephone and delete this communication (and any attachments) 
>> without making a copy.
>>
>> Before opening or using attachments, you should check them for viruses and 
>> defects. We do not accept liability in connection with computer virus, data 
>> corruption, delay, interruption, unauthorised access or unauthorised 
>> amendment.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
>
>
> This communication (and any attachments) is directed in confidence to the 
> addressee(s) listed above, and may not otherwise be distributed, copied or 
> used. The contents of this communication may also be subject to privilege, 
> and all rights to that privilege are expressly claimed and not waived. If you 
> have received this communication in error, please notify us by reply e-mail 
> or by telephone and delete this communication (and any attachments) without 
> making a copy.
>
> Before opening or using attachments, you should check them for viruses and 
> defects. We do not accept liability in connection with computer virus, data 
> corruption, delay, interruption, unauthorised access or unauthorised 
> amendment.
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
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