camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morten Engel ...@alpha-solutions.dk>
Subject onException and .process()
Date Fri, 27 Aug 2010 17:17:34 GMT

Hi,

I'm having a problem using a .process inside my onException handling. I
enter the Processor just fine, but exiting it, causes the original exception
to be thrown.

What I want to do is basicly;

onException(ExceptionType.class)
.useOriginalBody()
.handled(true)
.setHeader("subject", constant("headersubject")
.process(new Processor() {
   public void process(Exchange exchange) {
     //alter exchange body to include info from my Exception
   }
.to(http-endpoint);

Any log messages I include in the processor are logged before it exits, but
as soon as I'm done with the Processor, the exception is thrown. I've tried
to do a "exchange.setException(null);", but with no luck, try/catch blocks
inside the Processor did not help me either.

Is there anyway to remove or surppress this exception? Or any other smart
ways to include exception information into my originalBody, in order for me
to send an exact error mail?

Any hints would be greatly appreciated.



-- 
View this message in context: http://camel.465427.n5.nabble.com/onException-and-process-tp2740331p2740331.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message