docs: public SQLException exceptionWithQuery(SQLException sqlEx, PrepareResult prepareResult) {
      if (options.dumpQueriesOnException || sqlEx.getErrorCode() == 1064) {
        String querySql = prepareResult.getSql();
        String message = sqlEx.getMessage();
        if (options.maxQuerySizeToLog != 0 && querySql.length() > options.maxQuerySizeToLog - 3) {
          message += "\nQuery is: " + querySql.substring(0, options.maxQuerySizeToLog - 3) + "...";
        } else {
          message += "\nQuery is: " + querySql;
        }
        message += "\njava thread: " + Thread.currentThread().getName();
        return new SQLException(message, sqlEx.getSQLState(), sqlEx.getErrorCode(), sqlEx.getCause());
      }
      return sqlEx;
    }