openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1796329 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorInvocationContext.java
Date Fri, 26 May 2017 19:28:25 GMT
Author: struberg
Date: Fri May 26 19:28:25 2017
New Revision: 1796329

URL: http://svn.apache.org/viewvc?rev=1796329&view=rev
Log:
OWB-1182 allow interceptors to catch and retry the ctx.proceed()

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

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorInvocationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorInvocationContext.java?rev=1796329&r1=1796328&r2=1796329&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorInvocationContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorInvocationContext.java
Fri May 26 19:28:25 2017
@@ -60,7 +60,18 @@ public class InterceptorInvocationContex
                 return proceed();
             }
 
-            return interceptor.intercept(type, instances.get(interceptor), this);
+            try
+            {
+                return interceptor.intercept(type, instances.get(interceptor), this);
+            }
+            catch (Exception e)
+            {
+                // restore the original location
+                // this allows for catching an Exception inside an Interceptor
+                // and then try to proceed with the interceptor chain again.
+                index--;
+                throw e;
+            }
         }
         else
         {



Mime
View raw message