Author: pier
Date: Mon Nov  1 06:58:41 2004
New Revision: 56236

Modified:
   cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/runtime/Wiring.java
Log:
Make sure exceptions target-exceptions are re-thrown and not wrapped

Modified: 
cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/runtime/Wiring.java
==============================================================================
--- cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/runtime/Wiring.java   
(original)
+++ cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/runtime/Wiring.java   
Mon Nov  1 06:58:41 2004
@@ -13,6 +13,7 @@
 package org.apache.cocoon.kernel.runtime;
 
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 /**
@@ -40,6 +41,12 @@
      */
     public Object invoke(Object proxy, Method method, Object[] parameters)
     throws Throwable {
-        return(method.invoke(null, parameters));
+        try {
+            return(method.invoke(this.instance, parameters));
+        } catch (InvocationTargetException e) {
+            Throwable cause = e.getCause();
+            if (cause != null) throw cause;
+            throw e;
+        }
     }
 }

Reply via email to