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_r315388985
##########
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:
Also, why is this a static method?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]