mcvsubbu commented on a change in pull request #4532: Expose a method to 
determine if a QueryExceptionErrorCode represents a client-side error
URL: https://github.com/apache/incubator-pinot/pull/4532#discussion_r315427168
 
 

 ##########
 File path: 
pinot-common/src/main/java/org/apache/pinot/common/exception/QueryException.java
 ##########
 @@ -147,4 +148,24 @@ public static ProcessingException 
getException(ProcessingException processingExc
     copiedProcessingException.setMessage(errorType + ":\n" + errorMessage);
     return copiedProcessingException;
   }
+
+  /**
+   * Determines if a query-exception-error-code represents an error on the 
client side.
+   * @param errorCode  the error code from processing the query
+   * @return whether the code indicates client error or not
+   */
+  public static boolean isClientError(int errorCode) {
+    switch (errorCode) {
+      case QueryException.ACCESS_DENIED_ERROR_CODE:
+      case QueryException.JSON_COMPILATION_ERROR_CODE:
+      case QueryException.JSON_PARSING_ERROR_CODE:
+      case QueryException.QUERY_VALIDATION_ERROR_CODE:
+      case QueryException.PQL_PARSING_ERROR_CODE:
+      case QueryException.TOO_MANY_REQUESTS_ERROR_CODE: {
 
 Review comment:
   Please add a comment saying why we dont include 
BROKER_RESOURCE_MISSING_ERROR here as a client error.

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


With regards,
Apache Git Services

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

Reply via email to