Repository navigation
Raise ProjectNotFoundError when a project doesn't exist (#302) - #555
Closed
tonylampada wants to merge 3 commits into
Closed
tonylampada wants to merge 3 commits into
tonylampada wants to merge 3 commits into
Conversation
workspace.project("typo") raised a RoboflowError carrying the raw API JSON,
which names neither the workspace nor the project and doesn't say that a
trashed project answers the same 404 as a missing one. Map 404 from
GET /:workspace/:project to ProjectNotFoundError, which names both and lists
the three causes. Roboflow.project() now goes through the same adapter; the
new error also subclasses RuntimeError so existing except clauses still hold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Deliver checks (dm-brain playbooks/deliver):
|
CI installs ruff unpinned; 0.17 flags these two imports, unrelated to #302. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ent raises Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Review round (jarbas-review, local branch scope, one round):
|
Collaborator
Author
|
Night-loop drill run; closed by Selma. |
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.
Description
Fixes #302.
A typo'd or deleted project id in
workspace.project()(#302) leaves the user with an error that is just the API's raw JSON, so nobody can tell which project failed or why. A 404 now raisesProjectNotFoundError, which names the workspace and project id and points to Trash and API-key access as the likely causes. Serves O8 (one canonical API shape on every surface): SDK, CLI and API now report a missing project the same way.rfapi.get_project: 404 →ProjectNotFoundError(RoboflowError, RuntimeError); other statuses unchanged.Roboflow.project()now uses the same adapter. It still raisesRuntimeError, so existingexceptclauses keep working.project get, infer, version, model, video) get the clearer message for free. They still exit with code 3.ICN001CI predates this PR (unpinned ruff 0.17); one unrelated commit aliasesdatetime as dtto unblock it.deletedAt) and no-access projects, so the message lists all three.Type of change
How has this change been tested?
tests/test_project_not_found.py,responses). They fail on main and pass here. Full suite: 1233 OK.Any specific deployment considerations
None. This ships in the next SDK release.
Next step
Standalone fix. Next for O8: give CLI/SDK errors for other 404 lookups (versions, workspaces) the same treatment.
🤖 Generated with Claude Code