camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toomanyedwards <>
Subject How to trap most specific exceptions?
Date Fri, 20 Feb 2015 18:19:40 GMT
Hi all,
  I have situation like this.  My route can throw the following exceptions:
  ApplicationExceptionFoo->caused by IOException
  ApplicationExceptionBar->caused by IOException
  Generic IOException

I want to be able to specifically trap ApplicationExceptionFoo,
ApplicationExceptionBar and generic IOExceptions (that were not the cause
ApplicationExceptionFoo or ApplicationExceptionBar exceptions).  No matter
what order I define my onException handlers in Camel will always use the
IOException handler since Camel starts its exception matching at the bottom
of the exception cause chain rather the top. 


What's the camel best practice here to catch most specific exceptions first
rather than their more generic cause?  Thanks!

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

View raw message