code: public SQLException exceptionWithQuery(ByteBuffer buffer, SQLException sqlEx,
        boolean explicitClosed) {
      if (options.dumpQueriesOnException || sqlEx.getErrorCode() == 1064 || explicitClosed) {
        return exceptionWithQuery(subQuery(buffer), sqlEx, explicitClosed);
      }
      return sqlEx;
    }
docs: Return exception with query information's.
  
  @param buffer         query buffer
  @param sqlEx          current exception
  @param explicitClosed has connection been explicitly closed
  @return exception with query information