API, Core: Handle 404 from /v1/config for missing warehouses#16059
Open
oguzhanunlu wants to merge 2 commits intoapache:mainfrom
Open
API, Core: Handle 404 from /v1/config for missing warehouses#16059oguzhanunlu wants to merge 2 commits intoapache:mainfrom
oguzhanunlu wants to merge 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
approved these changes
Apr 20, 2026
Contributor
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM one nit comment about where to place the tests
| } | ||
| } | ||
|
|
||
| @Test |
Contributor
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
Contributor
Author
There was a problem hiding this comment.
Thanks @kevinjqliu ! I just pushed a new commit to move them.
ebyhr
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.