You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by be...@apache.org on 2011/04/06 22:57:35 UTC

svn commit: r1089622 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java

Author: bergmark
Date: Wed Apr  6 20:57:35 2011
New Revision: 1089622

URL: http://svn.apache.org/viewvc?rev=1089622&view=rev
Log:
[OWB-554] Allow bean thrown exceptions to propagate up the call stack from DelegateHandler

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java?rev=1089622&r1=1089621&r2=1089622&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java Wed Apr  6 20:57:35 2011
@@ -113,15 +113,27 @@ public class DelegateHandler implements 
             }
             catch (InvocationTargetException e)
             {
+                Throwable cause = e.getCause();
                 //If the wrapped exception tells us the method didn't exist, continue
-                if(e.getCause() instanceof NoSuchMethodException)
+                if(cause instanceof NoSuchMethodException)
                 {
                     continue;
                 }
                 
                 logger.error(OWBLogConst.ERROR_0012, e.getTargetException(), method.getName(), decorator.getClass().getName());
 
-                throw new WebBeansException(e);
+                if (cause instanceof Exception)
+                {
+                    throw (Exception) cause;
+                }
+                else if (cause instanceof Error)
+                {
+                    throw (Error) cause;
+                }
+                else
+                {
+                    throw new WebBeansException(e);
+                }
             }
             catch (IllegalAccessException e)
             {