API, Core: Handle 404 from /v1/config for missing warehouses#16059
API, Core: Handle 404 from /v1/config for missing warehouses#16059kevinjqliu merged 2 commits intoapache:mainfrom
Conversation
Add NoSuchWarehouseException and configErrorHandler that throws it on 404 responses with a valid error type, distinguishing missing warehouses from misconfigured URIs. Update RESTSessionCatalog to use the new handler for config calls.
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM one nit comment about where to place the tests
| } | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
nit these tests look out of place, perhaps we can move them to core/src/test/java/org/apache/iceberg/rest/TestErrorHandlers.java
There was a problem hiding this comment.
Thanks @kevinjqliu ! I just pushed a new commit to move them.
|
Is there anything else I can do to move this forward? @kevinjqliu @ebyhr |
|
Thanks for the ping! Let's move this forward. One note here is that this is only the REST client side change. We should follow up and make the server side change for |
|
Follow up for server side changes #16247 |
|
Thanks @kevinjqliu for the merge and the followup PR! |
Summary
Add
NoSuchWarehouseExceptionandConfigErrorHandlerto handle 404 responses from the/v1/configendpoint when a configured warehouse does not exist.This is the implementation counterpart to the spec change merged in #15746.
Handling ambiguous 404s
As discussed in #14965 , a 404 on
/v1/configcould mean either a missing warehouse or a misconfigured URL pointing to a non-Iceberg server. The handler checkserror.type() != nullto distinguish the two cases: valid Iceberg error responses include atypefield, a required field per schema#/components/schemas/ErrorModel, while non-Iceberg 404s don't.