Jackie-Jiang commented on a change in pull request #5705:
URL: https://github.com/apache/incubator-pinot/pull/5705#discussion_r457761728



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/exception/QueryException.java
##########
@@ -125,8 +126,17 @@ public static void setMaxLinesOfStackTrace(int 
maxLinesOfStackTrace) {
   }
 
   public static ProcessingException getException(ProcessingException 
processingException, Exception exception) {
+    return getException(processingException, 
getTruncatedStackTrace(exception));
+  }
+
+  public static ProcessingException getException(ProcessingException 
processingException, String errorMessage) {
     String errorType = processingException.getMessage();
     ProcessingException copiedProcessingException = 
processingException.deepCopy();
+    copiedProcessingException.setMessage(errorType + ":\n" + errorMessage);
+    return copiedProcessingException;
+  }
+
+  public static String getTruncatedStackTrace(Exception exception) {

Review comment:
       The `errorType` I referred to here is `BrokerResponseSendError` which 
you put in the `QueryException.class` so that users don't need to look up the 
int error code (425) to understand the type of the error. The error message of 
the Exception will be:
   ```
     BrokerResponseSendError:
     {stacktrace}
   ```
   
   I already approved the change. These comments are just suggestions. You can 
merge it




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to