Skip to content

Typed exception class for "ref not found" errors #2098

@samantha-earthmover

Description

@samantha-earthmover

Today, calling Repository.readonly_session_async(branch=...) (or tag=...) with a missing ref raises a generic icechunk.IcechunkError whose only signal that the ref is missing is the message text ("ref not found \`"`).

This forces callers that want to distinguish "ref doesn't exist" from "storage/manifest/IO failure" to do brittle message-substring matching.

Could we get a dedicated subclass — e.g. icechunk.RefNotFoundError(IcechunkError) — raised specifically for the missing-ref case? That'd let downstreams except RefNotFoundError cleanly and let other IcechunkErrors continue to surface as real failures.

Same ask would apply to lookup_branch_v2 / lookup_tag paths.

Concrete motivator: arraylake's booth tile/discovery service wants to return HTTP 404 for unknown branches/tags but 500 for genuine icechunk errors, and currently can't tell them apart without parsing the message.

[This is Claude Code on behalf of Samantha Hughes]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions