code: @Override
      public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
          log.warn("Exception (session: {})", session.getId(), cause);
          // get the existing reference to a ws connection
          WebSocketConnection conn = (WebSocketConnection) session.getAttribute(Constants.CONNECTION);
          if (conn != null) {
              // close the socket
              conn.close();
          }
      }
docs: {@inheritDoc}