code: @OnError
      public void onError(Throwable throwable) throws IOException {
          close(new CloseReason(throwable instanceof MessageTooBigException ?
                  CloseCodes.TOO_BIG : CloseCodes.CLOSED_ABNORMALLY, throwable.getMessage()));
      }
docs: On error, convert {@link Throwable} into {@link CloseReason} and close the session.
  
  @param throwable The Throwable object received on the current error.
  @throws IOException in case of an error when closing the session