code: public SQLException exceptionWithQuery(ParameterHolder[] parameters, SQLException sqlEx,
        PrepareResult serverPrepareResult) {
      if (sqlEx.getCause() instanceof SocketTimeoutException) {
        return new SQLException("Connection timed out", CONNECTION_EXCEPTION.getSqlState(), sqlEx);
      }
      if (options.dumpQueriesOnException) {
        return new SQLException(exWithQuery(sqlEx.getMessage(), serverPrepareResult, parameters),
            sqlEx.getSQLState(),
            sqlEx.getErrorCode(), sqlEx.getCause());
      }
      return sqlEx;
    }
docs: Return exception with query information's.
  
  @param parameters          query parameters
  @param sqlEx               current exception
  @param serverPrepareResult prepare results
  @return exception with query information