Skip to content

Fix error handling in VuMark database deletion#2972

Merged
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/fix-vumark-target-type
Feb 21, 2026
Merged

Fix error handling in VuMark database deletion#2972
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/fix-vumark-target-type

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 21, 2026

Summary

Add error handling to the delete_vumark_database endpoint to return a 404 instead of crashing with a 500 error when no matching VuMark database exists. The endpoint was missing the try/except ValueError pattern already present in delete_cloud_database.

Changes

  • Fixed delete_vumark_database to catch ValueError from unpacking when no database matches the provided name
  • Added test test_vumark_not_found to verify 404 is returned for missing databases
  • Added test test_delete_vumark_database to verify successful deletion and subsequent 404

Test Plan

  • All existing tests pass
  • New tests verify VuMark database deletion behavior matches cloud database deletion

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 unpacking ValueError and returning HTTPStatus.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.

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>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@adamtheturtle adamtheturtle enabled auto-merge (squash) February 21, 2026 00:38
@adamtheturtle adamtheturtle merged commit 4e91959 into main Feb 21, 2026
106 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/fix-vumark-target-type branch February 21, 2026 00:42
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.

1 participant