Skip to content

Fix foundry _get_app to raise ResourceNotFoundError for missing apps#2065

Merged
mrobers1982 merged 1 commit into
developfrom
mrobers1982/fix-backend-drift-assertions
Jul 13, 2026
Merged

Fix foundry _get_app to raise ResourceNotFoundError for missing apps#2065
mrobers1982 merged 1 commit into
developfrom
mrobers1982/fix-backend-drift-assertions

Conversation

@mrobers1982

@mrobers1982 mrobers1982 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

foundry_client._get_app is documented to raise ResourceNotFoundError for a missing app, and did so by mapping the API's InvalidQueryError. The API now returns a generic LabelboxError (App with id ... not found) instead, so it fell through to the generic wrapper and test_get_app_with_invalid_id (which asserts pytest.raises(ResourceNotFoundError)) failed.

This detects the not-found LabelboxError and re-raises ResourceNotFoundError, restoring the method's contract. ResourceNotFoundError is a subclass of LabelboxError, so all other errors still wrap exactly as before.

Verification

  • Confirmed on CI: test_get_app_with_invalid_id now PASSES against staging (run on f127af39).
  • ruff format --check + ruff check clean.

Note

This PR was originally going to also fix test_labeling_frontend_connecting_to_project, but CI revealed that's a deeper backend removal, not a stale assertion: connecting the legacy "Editor" labeling frontend now returns MalformedQueryException: Unsupported labeling frontend (per intelligence #30098, only modern Pictor editors are accepted; projects auto-attach the correct one). That test is being handled separately as a removed-capability case.

🤖 Generated with Claude Code

A missing app used to surface from the API as InvalidQueryError, which
_get_app mapped to ResourceNotFoundError. The API now returns a generic
"not found" LabelboxError instead, so it fell through to the generic wrapper
and test_get_app_with_invalid_id (asserting pytest.raises(ResourceNotFoundError))
failed. Detect the not-found LabelboxError and re-raise ResourceNotFoundError,
preserving the method's documented contract. ResourceNotFoundError is a
subclass of LabelboxError, so other errors still wrap as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mrobers1982
mrobers1982 force-pushed the mrobers1982/fix-backend-drift-assertions branch from f127af3 to 50aa884 Compare July 13, 2026 14:05
@mrobers1982 mrobers1982 changed the title Fix foundry not-found mapping and labeling-frontend test for backend changes Fix foundry _get_app to raise ResourceNotFoundError for missing apps Jul 13, 2026
@mrobers1982
mrobers1982 merged commit 81af1cd into develop Jul 13, 2026
15 of 26 checks passed
@mrobers1982
mrobers1982 deleted the mrobers1982/fix-backend-drift-assertions branch July 13, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants