camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: question about exception handling behavior
Date Tue, 19 Nov 2013 14:50:08 GMT
Use skipSendToOriginalEndpoint(). I left a comment on your gist.

Alternatively, since you're just using a mock endpoint, you can just
use the mock to throw the exception:

        getMockEndpoint("mock:exception").whenAnyExchangeReceived(new
Processor() {

            @Override
            public void process(Exchange exchange) throws Exception {
                throw new Exception("fail me");
            }
        });



On Tue, Nov 19, 2013 at 1:38 AM, Michiel Borkent
<michiel.borkent@finalist.nl> wrote:
> I mean the onException block
>
> Michiel Borkent
> Software Engineer
>
> Finalist -  open *IT* oplossingen
> Amsterdam - Eindhoven - Maarssen - Maastricht - Rotterdam
> *www.finalist.nl <http://www.finalist.nl/>*
>
>
> 2013/11/19 Michiel Borkent <michiel.borkent@finalist.nl>
>
>> Hi,
>>
>> In the following code: https://gist.github.com/anonymous/7534990
>> the onError block is triggered, even when I have a doTry/doCatch in my
>> route.
>> Is this expected behavior of camel or a bug?
>> I want to use an onError block to handle all unhandled exceptions, but not
>> the ones I catch myself in the route. How to do this?
>>
>> Kind regards,
>>
>> Michiel Borkent
>>



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Mime
View raw message