deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject git commit: DELTASPIKE-545 implemented #getRootCause to avoid NPE's
Date Sun, 23 Mar 2014 22:24:35 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 61c68f012 -> 72bf21777


DELTASPIKE-545 implemented #getRootCause to avoid NPE's

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

Branch: refs/heads/master
Commit: 72bf21777346b64a93afa33b43cec5b6b8b12fee
Parents: 61c68f0
Author: tandraschko <tandraschko@apache.org>
Authored: Sun Mar 23 23:24:24 2014 +0100
Committer: tandraschko <tandraschko@apache.org>
Committed: Sun Mar 23 23:24:24 2014 +0100

----------------------------------------------------------------------
 .../jsf/impl/exception/DeltaSpikeExceptionHandler.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/72bf2177/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
index e2b8f47..360655a 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
@@ -20,6 +20,7 @@ package org.apache.deltaspike.jsf.impl.exception;
 
 import java.lang.annotation.Annotation;
 import java.util.Iterator;
+import javax.el.ELException;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.faces.FacesException;
 import javax.faces.context.ExceptionHandler;
@@ -102,6 +103,18 @@ public class DeltaSpikeExceptionHandler extends ExceptionHandlerWrapper
implemen
         super.handle();
     }
 
+    @Override
+    public Throwable getRootCause(Throwable throwable)
+    {
+        while ((ELException.class.isInstance(throwable) || FacesException.class.isInstance(throwable))
+                && throwable.getCause() != null)
+        {
+            throwable = throwable.getCause();
+        }
+
+        return throwable;
+    }
+
     private void lazyInit()
     {
         if (this.initialized == null)


Mime
View raw message