maytasm commented on code in PR #19745:
URL: https://github.com/apache/druid/pull/19745#discussion_r3649650708


##########
server/src/main/java/org/apache/druid/server/QueryResource.java:
##########
@@ -181,6 +183,15 @@ public Response doPost(
       try {
         authResult = queryLifecycle.authorize(req);
       }
+      catch (DruidException e) {
+        // Handled separately from QueryException so that the exception's own 
category (for example FORBIDDEN for a
+        // blocklisted query) determines the status code. Wrapping it below 
would erase that and report a 500.
+        return QueryResultPusher.handleDruidExceptionBeforeResponseStarted(
+            e,

Review Comment:
   Do we need to transform using 
`serverConfig.getErrorResponseTransformStrategy()`



##########
server/src/main/java/org/apache/druid/server/QueryResource.java:
##########
@@ -181,6 +183,15 @@ public Response doPost(
       try {
         authResult = queryLifecycle.authorize(req);
       }
+      catch (DruidException e) {
+        // Handled separately from QueryException so that the exception's own 
category (for example FORBIDDEN for a
+        // blocklisted query) determines the status code. Wrapping it below 
would erase that and report a 500.
+        return QueryResultPusher.handleDruidExceptionBeforeResponseStarted(
+            e,
+            MediaType.valueOf(io.getResponseWriter().getResponseType()),
+            ImmutableMap.of()

Review Comment:
   Do we need to add QUERY_ID_RESPONSE_HEADER to this Map?



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