private void notifyHandlers(HandledException result) { // Injector might not have run yet if (handlers == null || Boolean.TRUE.equals(frozen.get())) { return; } try { frozen.set(Boolean.TRUE); String location = computeLocation(result); for (ExceptionHandler handler : handlers) { try { handler.handle(new Incident(log.getName(), location, CallContext.getCurrent().getMDC(), result)); } catch (Exception e) { // Just log the exception - anything else might call a rather long infinite loop LOG.SEVERE(new Exception(Strings.apply( "An error occurred while calling the ExceptionHandler: %s - %s (%s)", handler, e.getMessage(), e.getClass().getName()), e)); } } } finally { frozen.set(Boolean.FALSE); } }