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(DEFAULT_INFO);
    return tStatus;
  }
Converts the specified {@link Exception} object into a {@link TStatus}
object.

@param e a {@link Exception} object
@return a {@link TStatus} object
service/src/java/org/apache/hive/service/cli/HiveSQLException.java