Skip to content

Commit

Permalink
Fixes #1418
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Jan 6, 2014
1 parent b703912 commit 95e2139
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,13 @@ private String path(AtmosphereRequest request) {
private Action invokeInterceptors(List<AtmosphereInterceptor> 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;
Expand All @@ -353,8 +359,15 @@ private Action invokeInterceptors(List<AtmosphereInterceptor> c, AtmosphereResou
}

private void postInterceptors(List<AtmosphereInterceptor> 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;
}
}
}

Expand Down

0 comments on commit 95e2139

Please sign in to comment.