singhpk234 opened a new pull request, #16024:
URL: https://github.com/apache/iceberg/pull/16024

     Per the OpenAPI spec, FailedPlanningResult extends IcebergErrorResponse 
via allOf — when server-side scan planning fails, the response is an HTTP 200 
with status: "failed" and a
      full ErrorModel (message, type, code) in the body:
   
   ```
     {
       "status": "failed",
       "error": {
         "message": "No active warehouse selected in the current session",
         "type": "IllegalStateException",
         "code": 500
       }
     }
   ```
   
     Currently the SDK discards this error information entirely. RESTTableScan 
throws a generic IllegalStateException like:
   
    >  Invalid planStatus: failed for planId: 6594660417062534
   
     After this change, the server's error message is surfaced:
   
    > Received status: failed for planId: 6594660417062534. Server error: I am 
on fire
     Changes
   
     - Add ErrorResponse errorResponse field to FetchPlanningResultResponse and 
PlanTableScanResponse with an errorMessage() convenience accessor
     - Parse the error object via existing ErrorResponseParser in both 
FetchPlanningResultResponseParser and PlanTableScanResponseParser
     - Serialize the error as a spec-compliant ErrorModel (message, type, code) 
in toJson
     - Extract ErrorResponseParser.writeErrorField() to avoid duplicating 
serialization logic across parsers
     - Include the server error message in exceptions thrown by RESTTableScan 
for both planTableScan and fetchPlanningResult code paths
   
   
   used ai to generate the pr 


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