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.bork...@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.bork...@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

Reply via email to