Commit 2eb1c2a
fix: raise precise exception in rest_catalog list_namespaces (apache#1977)
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
# Rationale for this change
`list_namespaces` should raise a `NoSuchNamespaceException` instead of a
generic `RestException` in case of a 404 response.
https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml#L279-L287
Also this is in line with the Java implementation of
[NamespaceErrorHandler](https://github.com/apache/iceberg/blob/9fb80b7167e58a2daef80f4a1a09f223b870c030/core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java#L182)
used by
`[listNamespaces()](https://github.com/apache/iceberg/blob/9fb80b7167e58a2daef80f4a1a09f223b870c030/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java#L584)`
# Are these changes tested?
I added a unit test for it
# Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->1 parent 3bb47ef commit 2eb1c2a
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
| 827 | + | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
558 | 576 | | |
559 | 577 | | |
560 | 578 | | |
| |||
0 commit comments