public TStatus toTStatus() {
    // TODO: convert sqlState, etc.
    TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS);
    tStatus.setSqlState(getSQLState());
    tStatus.setErrorCode(getErrorCode());
    tStatus.setErrorMessage(getMessage());
    tStatus.setInfoMessages(DEFAULT_INFO);
    return tStatus;
  }
Converts current object to a {@link TStatus} object.

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