Fix error handling in VuMark database deletion#2972
Merged
adamtheturtle merged 1 commit intomainfrom Feb 21, 2026
Merged
Conversation
The delete_vumark_database endpoint was missing the try/except ValueError error handling present in delete_cloud_database. When no matching VuMark database exists, the set unpacking raises an unhandled ValueError, resulting in a 500 error instead of a 404 response. Added proper error handling and corresponding tests. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| if database_name == database.database_name | ||
| } | ||
| except ValueError: | ||
| return Response(response="", status=HTTPStatus.NOT_FOUND) |
There was a problem hiding this comment.
ValueError conflates not-found and duplicates
Low Severity
delete_vumark_database catches any ValueError from the single-item unpack, so both “no matches” and “multiple matches” return HTTPStatus.NOT_FOUND. If duplicate database_names ever exist (e.g., due to state corruption or future changes), the endpoint silently reports 404 instead of surfacing the invariant violation.
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.


Summary
Add error handling to the
delete_vumark_databaseendpoint to return a 404 instead of crashing with a 500 error when no matching VuMark database exists. The endpoint was missing thetry/except ValueErrorpattern already present indelete_cloud_database.Changes
delete_vumark_databaseto catchValueErrorfrom unpacking when no database matches the provided nametest_vumark_not_foundto verify 404 is returned for missing databasestest_delete_vumark_databaseto verify successful deletion and subsequent 404Test Plan
Note
Low Risk
Small change limited to mock Flask endpoint error handling plus tests; behavior now matches existing cloud database deletion and should only reduce 500s.
Overview
Prevents the
DELETE /vumark_databases/<database_name>endpoint from erroring when the requested database doesn’t exist by catching the unpackingValueErrorand returningHTTPStatus.NOT_FOUND.Adds integration tests to verify VuMark deletion succeeds once and then returns 404 on subsequent deletes, and that deleting a nonexistent VuMark database returns 404.
Written by Cursor Bugbot for commit 8eaacf9. This will update automatically on new commits. Configure here.