Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-M3
-
None
-
XP, JDK 1.5.0_16
-
Patch Available
Description
The CamelInvocationHandler.invoke() method should throw the RuntimeException if the fault is a RuntimeException instead of throwing an InvocationTargetException with the RuntimeException included.
This would allow to use the @Produce to inject a direct endpoint on a pojo (that acts as a service interface) and the calling side would receive the RuntimeException instead of the UndeclaredThrowableException. With this behaviour the error handling on the calling side would be the same as if no camel route is between the caller and the called pojo.
The attached testcase is based on the original testcase that was commited here: http://svn.apache.org/viewvc?view=rev&revision=801511
See also http://www.nabble.com/Camel-Spring-Remoting-throwing-RuntimeException-question-td24825646.html for more info.