camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pvenini <>
Subject Rethrow original exception
Date Wed, 06 Jun 2012 18:34:40 GMT
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. 

  //Let it pass forward
  throwException(new A("Some message", false)).

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.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message