camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gnanaguru S <gnanagu...@gmail.com>
Subject Throw exception on Exception
Date Mon, 23 Jun 2014 07:31:58 GMT
Hello Camel Folks, 

In my global error handler I am throwing a custom exception which is handled
by another global handler. 

Is it a valid flow in camel ? 

When I unit tested, It throws custom exception even in positive scenario :(

*<onException>*
	<exception>org.apache.camel.ValidationException</exception>
	<continued>
		<constant>true</constant>
	</continued>

	<setBody>
		<simple>&lt;data/&gt;</simple>
	</setBody>

	<to ref="response-primary-xslt" />

	<doTry id="validate-error-response">

		<to uri="validator:schemas/elements-v1.xsd" />

		<doCatch>
			<exception>org.apache.camel.ValidationException</exception>
			*<throwException ref="customException" />*
		</doCatch>
	</doTry>

*</onException>*

*<onException>*
	<exception>com.company.CustomException</exception>
	<handled>
		<constant>true</constant>
	</handled>

	<to ref="response-secondary-xslt" />
*</onException>*


Bean reference:
<bean id=&quot;&lt;b>customException*" class="com.company.CustomException"/>

Cheers
Guru
gnanaguru.com



--
View this message in context: http://camel.465427.n5.nabble.com/Throw-exception-on-Exception-tp5752693.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message