code: public static TStatus toTStatus(Exception e) {
      if (e instanceof HiveSQLException) {
        return ((HiveSQLException)e).toTStatus();
      }
      TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS);
      tStatus.setErrorMessage(e.getMessage());
      tStatus.setInfoMessages(toString(e));
      return tStatus;
    }
docs: Converts the specified {@link Exception} object into a {@link TStatus} object
  @param e a {@link Exception} object
  @return a {@link TStatus} object