ankitsultana commented on issue #12190:
URL: https://github.com/apache/pinot/issues/12190#issuecomment-1866987690

   I think I can explain better with an example.
   
   The existing API returns responses like this:
   
   ```
   < HTTP/1.1 200 OK
   < Content-Type: application/json
   < Content-Length: 1009
   <
   * Connection #0 to host localhost left intact
   {
     "exceptions": [
       {
         "errorCode": 190,
         "message": "TableDoesNotExistError"
       }
     ],
     "numServersQueried": 0,
     ...
   ```
   
   HTTP Status Code is 200, and the error details are in the JSON Blob.
   
   What we were proposing is that we can add a header in the response, 
`X-Pinot-Error-Code`, which will be set to the corresponding Pinot Error Code 
(190 in this case).
   
   We can't change the existing HTTP Status Code because that would be 
backwards incompatible, so adding a header is a way to hint the caller that 
there was a error. The goal is that the caller shouldn't have to parse the JSON 
to determine if a query failed or not.


-- 
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: commits-unsubscr...@pinot.apache.org

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