public static PrintStream getErrStream() {
      SessionState ss = SessionState.get();
      return ((ss != null) && (ss.err != null)) ? ss.err : System.err;
    }
Get the console error stream for HiveServer2 or HiveCli.
@return The error stream
ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java