Claus Ibsen-2 wrote:
> 
> On Tue, May 12, 2009 at 2:13 AM, Joe Gottman <josephgott...@comcast.net>
> wrote:
> 
> Can you show the route DSL how you do this? You should generally use
> handled(true) to clear the exception.
> Or use doTry() .. doCatch() just as you would use try .. catch in normal
> Java
> http://camel.apache.org/try-catch-finally.html
> 
> Or if you use a processor, you should be able to do
> exchange.setException(null) to clear the exception.
> 
> 
> 

   
onException(JAXBException.class)
.handled(true)
.bean(CamelErrorHandler.class, "handleJaxbError")
.to("log:XML?level=ERROR&showBodyType=false");

Where CamelErrorHandler is a class I wrote and
CamelErrorHandler.handleJaxbError() takes a parameter of type JAXBException.
We use @Property("CamelExceptionCaught") to bind the Exception to the
parameter.  I can replace the .bean() step with a .setBody("Hello World"),
and still the original exception stack trace is output to the log.  I know
that the handleJaxbError function is being called because I can set a
breakpoint in it.
-- 
View this message in context: 
http://www.nabble.com/Handling-Exception-from-marshal-unmarshal-tp23494097p23502031.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to