You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rburdet <ro...@semperti.com> on 2016/08/12 15:02:23 UTC

Extrange behaviour of exceptions

Hi. i have some doubts about the execution of these camel routes: 

        <route id="route1">
            <from uri="direct:start"/>
            <onException>
            	<exception>java.lang.Exception</exception>
           	<bean ref="exceptionUtil" method="handleException"/>
            </onException>
           <to uri="direct:invokerMainRoute"/>
           <to uri="mock:result"/>
        </route>

        <route id="route2">
            <from uri="direct:start"/>
            <onException>
            	<exception>javax.ws.rs.ServiceUnavailableException</exception>
           	<bean ref="exceptionUtil" method="handleException"/>
          </onException>
           <to uri="direct:invokerMainRoute"/>
           <to uri="mock:result"/>
        </route>

        <route id="route3">
            <from uri="direct:start"/>
            <doTry>
            	<to uri="direct:invokerMainRoute"/>
            	<to uri="mock:result"/>
            	<camel:doCatch>
            		<exception>javax.ws.rs.ServiceUnavailableException</exception>
            		<bean ref="exceptionUtil" method="handleException"/>
            	</camel:doCatch>
	        </doTry>
        </route>

route1 and route3 throws and catch the exception and expected. 
But it doesnt happen the same with route2. The exception is not catch at all
and is very similar as route3.

for more information it would be better to say that invokerMainRoute throws
a javax.ws.rs.ServiceUnavailableException.

Thanks ! 



--
View this message in context: http://camel.465427.n5.nabble.com/Extrange-behaviour-of-exceptions-tp5786363.html
Sent from the Camel - Users mailing list archive at Nabble.com.