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/23 15:59:15 UTC

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

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



##########
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:
       So, the error message itself is captured in `setErrorMessage`.  The `Info Messages` is currently populated with the Exception stacktrace.  We should not be sending such internal details to the client.  Removing it altogether would be too big of a change, so I just put a static message in there for now as filler.




----------------------------------------------------------------
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