refactor(storage)!: split the Iceberg exceptions into a client and an api base - #1699
Open
spydon wants to merge 1 commit into
Open
refactor(storage)!: split the Iceberg exceptions into a client and an api base#1699spydon wants to merge 1 commit into
spydon wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
spydon
force-pushed
the
breaking/supabase-exception-base
branch
from
August 12, 2026 15:30
dd6f916 to
2476ef4
Compare
…api base `IcebergException` was the last exception hierarchy still using `0` as its status code when a request never reached the catalog, so callers had to know that `statusCode == 0` meant "no response" rather than a real status. It now extends `SupabaseException` and splits the way the other packages do: - `IcebergNetworkException` covers the transport case and reports no status. - `IcebergApiException` is a new sealed base for everything the catalog answered, mixes in `SupabaseApiException`, and carries a non-nullable `statusCode`. The six concrete response subtypes now extend it and are otherwise unchanged. `type` becomes the inherited `errorCode`, since it is the Iceberg error type such as `NoSuchTableException`. `message`, `code` and `details` keep their names, and `fromResponse` moves to `IcebergApiException` because it only ever builds response backed subtypes. Exhaustive switches over the hierarchy still compile with the same cases: the new base is sealed and no concrete subtype changed.
spydon
force-pushed
the
breaking/iceberg-exception-base
branch
from
August 12, 2026 15:30
62e61c8 to
c51e27b
Compare
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.
Stacked on #1644, which introduces
SupabaseExceptionandSupabaseApiException. Review that one first; this PR only touches the Iceberg exceptions. Under the v3 umbrella #1278.Follows up on @Vinzent03's question about why Iceberg was left out. It should not have been: it was the closest fit of anything not yet migrated, and it carried the same status code sentinel that #1644 removed from
FunctionsFetchException.What
IcebergExceptionused0as the status code when a request never reached the catalog:So a caller reading
statusCodehad to know that0meant "no response" rather than a real status. The sealed hierarchy now splits the same way as auth, storage and functions:IcebergApiExceptionis itselfsealed, so the six concrete subtypes stay closed and unchanged, and exhaustive switches over the hierarchy compile with exactly the same set of cases as before.Breaking changes
IcebergException.typeerrorCode, inherited fromSupabaseExceptionIcebergException.statusCodeIcebergApiException.statusCode; gone from the network caseIcebergException.statusCode == 0IcebergNetworkException, or checkis SupabaseApiExceptionIcebergException.fromResponseIcebergApiException.fromResponsemessage,codeanddetailskeep their names.codeis still the Iceberg numeric error code, which is unrelated toerrorCode, the error type string such asNoSuchTableException.typebecomeserrorCodebecause that is exactly whatSupabaseException.errorCodeis for, the same wayStorageException.errorbecameerrorCodein #1644. The wire format is untouched:fromResponsestill reads thetypefield out of the response body.An Iceberg failure is now also reachable through the shared types, so a single catch covers it alongside any other service:
Testing
dart analyze,dcm analyzeanddart formatare clean. Thestorage_clientsuite passes, including two new tests: one asserting that every subtypefromResponsecan build is aSupabaseApiExceptionwhileIcebergNetworkExceptionis not, and one asserting that a network failure keeps the originating error indetails. The existing error tests were updated for the renamed field and the moved factory.The capability matrix symbol, drift and schema checks pass with
IcebergApiExceptionregistered.MIGRATION.mdgains a section for the split, next to the one #1644 adds.