camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pvenini <pven...@mervaros.com.ar>
Subject Rethrow original exception
Date Wed, 06 Jun 2012 18:34:40 GMT
Hi, 
I've a situation where a route can throw many kinds of exceptions, say A, B,
and C. If exception is class A I should let it pass; if it's any other kind
of exception I should throw a new exception of class A. 

doTry().
  .
  .
  .
doCatch(A.class).
  //Let it pass forward
doCatch(Exception.class).
  throwException(new A("Some message", false)).
stop();

I'm having problems with the first situation (let the original exception A
go forward); I tried to use handled(false) but it says it's deprecated, so I
chose to use throwException(). However I' don't know how to get the original
exception or if that's is impossible, how to get the text from the original
exception and create a new one (tried to use exceptionMessage but I don't
know how to convert a ValueBuilder to a String).

Any help would be appreciated.

Pablo

--
View this message in context: http://camel.465427.n5.nabble.com/Rethrow-original-exception-tp5714087.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message