deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-723 rethrow faces-exceptions instead of InvocationTargetException
Date Tue, 16 Sep 2014 22:32:54 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master d8d70fe9f -> f041be252


DELTASPIKE-723 rethrow faces-exceptions instead of InvocationTargetException


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/f041be25
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/f041be25
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/f041be25

Branch: refs/heads/master
Commit: f041be25280d38987067529062b7e0fee1bd1575
Parents: d8d70fe
Author: gpetracek <gpetracek@apache.org>
Authored: Wed Sep 17 00:27:30 2014 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Wed Sep 17 00:31:09 2014 +0200

----------------------------------------------------------------------
 .../injection/proxy/DelegatingMethodHandler.java | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f041be25/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/injection/proxy/DelegatingMethodHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/injection/proxy/DelegatingMethodHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/injection/proxy/DelegatingMethodHandler.java
index 4da76ff..4f91252 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/injection/proxy/DelegatingMethodHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/injection/proxy/DelegatingMethodHandler.java
@@ -18,7 +18,9 @@
  */
 package org.apache.deltaspike.jsf.impl.injection.proxy;
 
+import javax.faces.FacesException;
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 /**
@@ -36,10 +38,21 @@ class DelegatingMethodHandler<T extends InvocationHandler>
     //Signature given by javassist.util.proxy.MethodHandler#invoke
     public Object invoke(Object target, Method method, Method proceedMethod, Object[] arguments)
throws Throwable
     {
-        if (proceedMethod != null)
+        try
         {
-            return proceedMethod.invoke(target, arguments);
+            if (proceedMethod != null)
+            {
+                return proceedMethod.invoke(target, arguments);
+            }
+            return this.handlerInstance.invoke(target, method, arguments);
+        }
+        catch (InvocationTargetException e)
+        {
+            if (e.getCause() instanceof FacesException)
+            {
+                throw e.getCause();
+            }
+            throw e;
         }
-        return this.handlerInstance.invoke(target, method, arguments);
     }
 }


Mime
View raw message