You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/22 17:32:54 UTC

[GitHub] [hive] aihuaxu commented on a change in pull request #1974: HIVE-24772: Revamp Server Request Error Logging

aihuaxu commented on a change in pull request #1974:
URL: https://github.com/apache/hive/pull/1974#discussion_r580443156



##########
File path: service/src/java/org/apache/hive/service/cli/HiveSQLException.java
##########
@@ -102,149 +115,39 @@ public HiveSQLException(String reason, String sqlState, int vendorCode, Throwabl
   }
 
   public HiveSQLException(TStatus status) {
-    // TODO: set correct vendorCode field
     super(status.getErrorMessage(), status.getSqlState(), status.getErrorCode());
-    if (status.getInfoMessages() != null) {
-      initCause(toCause(status.getInfoMessages()));
-    }
   }
 
-
-
-/**
-   * Converts current object to a {@link TStatus} object
-   * @return	a {@link TStatus} object
+  /**
+   * Converts current object to a {@link TStatus} object.
+   *
+   * @return a {@link TStatus} object
    */
   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(toString(this));
+    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
+   * Converts the specified {@link Exception} object into a {@link TStatus}
+   * object.
+   *
+   * @param e a {@link Exception} object
+   * @return a {@link TStatus} object
    */
   public static TStatus toTStatus(Exception e) {
     if (e instanceof HiveSQLException) {
-      return ((HiveSQLException)e).toTStatus();
+      return ((HiveSQLException) e).toTStatus();
     }
     TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS);
     tStatus.setErrorMessage(e.getMessage());
-    tStatus.setInfoMessages(toString(e));
+    tStatus.setInfoMessages(DEFAULT_INFO);

Review comment:
       Basically we will throw a general message instead of explicit error message? Is that because we already have such information in ErrorMessage?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org