Author: mir
Date: Thu Feb 18 13:46:05 2010
New Revision: 911399

URL: http://svn.apache.org/viewvc?rev=911399&view=rev
Log:
CLEREZZA-131: AccessControlExceptions thrown by SubResources are now rethrown

Modified:
    
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.triaxrs/org.apache.clerezza.triaxrs/src/main/java/org/apache/clerezza/triaxrs/RootResourceExecutorImpl.java

Modified: 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.triaxrs/org.apache.clerezza.triaxrs/src/main/java/org/apache/clerezza/triaxrs/RootResourceExecutorImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.triaxrs/org.apache.clerezza.triaxrs/src/main/java/org/apache/clerezza/triaxrs/RootResourceExecutorImpl.java?rev=911399&r1=911398&r2=911399&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.triaxrs/org.apache.clerezza.triaxrs/src/main/java/org/apache/clerezza/triaxrs/RootResourceExecutorImpl.java
 (original)
+++ 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.triaxrs/org.apache.clerezza.triaxrs/src/main/java/org/apache/clerezza/triaxrs/RootResourceExecutorImpl.java
 Thu Feb 18 13:46:05 2010
@@ -18,7 +18,6 @@
  */
 package org.apache.clerezza.triaxrs;
 
-import java.io.StringWriter;
 import java.util.Iterator;
 import org.apache.clerezza.jaxrs.extensions.ResourceMethodException;
 import org.apache.clerezza.jaxrs.extensions.HttpRequest;
@@ -29,6 +28,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.security.AccessControlException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -546,6 +546,9 @@
                        throw new WebApplicationException(500);
                } catch (InvocationTargetException ex) {
                        logger.error("Exception {}", ex);
+                       if (ex.getCause() instanceof AccessControlException) {
+                               throw (AccessControlException) ex.getCause();
+                       }
                        throw new WebApplicationException(500);
                }
        }


Reply via email to