@Override public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) { try { securityContext.updateCurrentSession(); // it should handle any exceptions here... } catch ( Throwable cause ) { log.error( "Can't update the current session: " + cause.getMessage(), cause ); } finally { nextListener.proceed(); } } }