void handleSQLException(SQLException e) {
    if (e instanceof SQLWarning && !(getOpts().getShowWarnings())) {
      return;
    }

    if (e.getCause() instanceof TTransportException) {
      switch (((TTransportException)e.getCause()).getType()) {
        case TTransportException.ALREADY_OPEN:
          error(loc("hs2-connection-already-open"));
          break;
        case TTransportException.END_OF_FILE:
          error(loc("hs2-unexpected-end-of-file"));
          break;
        case TTransportException.NOT_OPEN:
          error(loc("hs2-could-not-open-connection"));
          break;
        case TTransportException.TIMED_OUT:
          error(loc("hs2-connection-timed-out"));
          break;
        case TTransportException.UNKNOWN:
          error(loc("hs2-unknown-connection-problem"));
          break;
        default:
          error(loc("hs2-unexpected-error"));
      }
    }

    error(loc(e instanceof SQLWarning ? "Warning" : "Error",
        new Object[] {
            e.getMessage() == null ? "" : e.getMessage().trim(),
            e.getSQLState() == null ? "" : e.getSQLState().trim(),
            Integer.valueOf(e.getErrorCode())}));

    if (getOpts().getVerbose()) {
      e.printStackTrace(getErrorStream());
    }

    if (!getOpts().getShowNestedErrs()) {
      return;
    }

    for (SQLException nested = e.getNextException(); nested != null && nested != e; nested = nested
        .getNextException()) {
      handleSQLException(nested);
    }
  }
Output a progress indicator to the console.

@param cur
         the current progress
@param max
         the maximum progress, or -1 if unknown
beeline/src/java/org/apache/hive/beeline/BeeLine.java