sajjad-moradi commented on a change in pull request #5705:
URL: https://github.com/apache/incubator-pinot/pull/5705#discussion_r456153839



##########
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:
       `getException` method takes `ProcessingException` as its argument while 
we need to construct a `QueryProcesssingException` to pass it in broker 
response. That's why i did that refactoring.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to