diff --git a/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java b/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java index 7c09d5626d7..d8b97202558 100755 --- a/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java +++ b/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java @@ -332,7 +332,13 @@ private String path(AtmosphereRequest request) { private Action invokeInterceptors(List c, AtmosphereResource r) { Action a = Action.CONTINUE; for (AtmosphereInterceptor arc : c) { - a = arc.inspect(r); + try { + a = arc.inspect(r); + } catch (Exception ex) { + logger.error("Interceptor {} crashed. Processing will continue with other interceptor.", arc, ex); + continue; + } + if (a == null) { logger.trace("Action was null for {}", arc); a = Action.CANCELLED; @@ -353,8 +359,15 @@ private Action invokeInterceptors(List c, AtmosphereResou } private void postInterceptors(List c, AtmosphereResource r) { + AtmosphereInterceptor arc = null; for (int i = c.size() - 1; i > -1; i--) { - c.get(i).postInspect(r); + try { + arc = c.get(i); + arc.postInspect(r); + } catch (Exception ex) { + logger.error("Interceptor {} crashed. Processing will continue with other interceptor.", arc, ex); + continue; + } } }