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

   ## Summary
   
   This PR proposes adding HTTP 404 as a documented response for the 
`/v1/config` endpoint in the REST Catalog OpenAPI specification.
   
   - The OpenAPI spec is amended to allow 404 (Not Found) if a warehouse does 
not exist
   - The core Java library is amended to raise a `NoSuchWarehouseException` 
corresponding to this error response
   - Unit test to assert 404 response yield the expected exception in the Java 
core library
   
   ## Rationale
   
   The `/v1/config` endpoint allows an optional query parameter for a warehouse 
identifier, e.g. `/v1/config?warehouse=mywarehouse`.  But the openapi spec does 
not specify what should happen if the requested warehouse does not exist.
   
   We noticed that Snowflake Open Catalog already returns a 404 for 
non-existent warehouses:
   
   ```json
   {
     "error": {
       "message": "Unable to find warehouse NONEXISTENT_WAREHOUSE_12345",
       "type": "NotFoundException",
       "code": 404
     }
   }
   ```
   
   This PR therefore formalizes what Snowflake Open Catalog is already doing in 
production.  It seems sensible to formalize the 404 response code, because this 
is consistent with other Iceberg REST endpoints which allow a 404 response code 
for missing respources (tables, namespaces, views).
   
   ## Our use case
   
   At my company we triage Iceberg exceptions according to their type.  For 
example, an exception for a missing resource might get triaged to the team 
responsible for providing that resource.
   
   Currently, the Iceberg core library yields the generic `RESTException` if a 
warehouse does not exist.  It is difficult to automatically triage the generic 
`RESTException`.  It would help us if Iceberg could yield the 
`NoSuchWarehouseException` instead, so our application code can more 
confidently triage this runtime issue.
   
   We expect other Iceberg users have similar operational workflows where 
distinguishing warehouse configuration errors from other failures would improve 
their incident response.
   


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