Jackie-Jiang commented on code in PR #11624:
URL: https://github.com/apache/pinot/pull/11624#discussion_r1330903391


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -465,4 +471,12 @@ public String sendRequestRaw(String url, String query, 
ObjectNode requestJson, M
       throw new AssertionError("Should not reach this");
     }
   }
+
+  private static String constructQueryExceptionResponse(ProcessingException 
pe) {
+    try {
+      return new BrokerResponseNative(pe).toJsonString();
+    } catch (IOException ioe) {
+      throw new AssertionError("Should not reach this");

Review Comment:
   Don't do assertion error in production code. You may use 
`Utils.rethrowException(ioe)` to workaround the checked exception if you prefer 
that way
   ```suggestion
         throw new RuntimeException("Caught exception serializing the 
response", ioe);
   ```



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

To unsubscribe, e-mail: [email protected]

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