You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2013/02/13 22:25:00 UTC

svn commit: r1445936 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/AbstractInvocationContext.java

Author: struberg
Date: Wed Feb 13 21:25:00 2013
New Revision: 1445936

URL: http://svn.apache.org/r1445936
Log:
OWB-344 properly unwrap InvocationTargetException

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/AbstractInvocationContext.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/AbstractInvocationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/AbstractInvocationContext.java?rev=1445936&r1=1445935&r2=1445936&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/AbstractInvocationContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/AbstractInvocationContext.java Wed Feb 13 21:25:00 2013
@@ -18,12 +18,15 @@
  */
 package org.apache.webbeans.intercept;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.interceptor.InvocationContext;
 
+import org.apache.webbeans.util.ExceptionUtil;
+
 public abstract class AbstractInvocationContext<T> implements InvocationContext
 {
 
@@ -93,6 +96,14 @@ public abstract class AbstractInvocation
     @Override
     public Object proceed() throws Exception
     {
-        return method.invoke(target, parameters);
+        try
+        {
+            return method.invoke(target, parameters);
+        }
+        catch (InvocationTargetException ite)
+        {
+            // unpack the reflection Exception
+            throw ExceptionUtil.throwAsRuntimeException(ite.getCause());
+        }
     }
 }