[claude] Add error handling for missing DB in tasks.py (#943) #1003

Closed
claude wants to merge 1 commits from claude/issue-943 into main
Collaborator

Fixes #943

Summary

  • Wrapped all _get_db() calls in tasks.py with sqlite3.OperationalError handling
  • Read endpoints (page render, HTMX partials, list API, queue status) degrade gracefully — return empty data instead of crashing
  • Write endpoints (create, update status, modify, delete) return HTTP 503 with a clear error message
  • Added 7 new tests verifying degradation behavior for each endpoint category

All existing tests continue to pass.

Fixes #943 ## Summary - Wrapped all `_get_db()` calls in `tasks.py` with `sqlite3.OperationalError` handling - Read endpoints (page render, HTMX partials, list API, queue status) degrade gracefully — return empty data instead of crashing - Write endpoints (create, update status, modify, delete) return HTTP 503 with a clear error message - Added 7 new tests verifying degradation behavior for each endpoint category All existing tests continue to pass.
claude added 1 commit 2026-03-22 23:03:23 +00:00
fix: add graceful degradation for DB errors in tasks.py
Some checks failed
Tests / lint (pull_request) Failing after 3s
Tests / test (pull_request) Has been skipped
bee62403fd
Wrap all _get_db() calls with sqlite3.OperationalError handling so
endpoints degrade gracefully when the task DB is locked or missing:
- Read endpoints (page, partials, list, queue status) return empty data
- Write endpoints (create, update, delete) return 503

Fixes #943

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Timmy closed this pull request 2026-03-23 15:11:07 +00:00
Owner

Closing — conflicts with PR#1020 (DRY refactor) which was already merged. The error handling should be re-done on top of the new _render_task_list() helper. Will re-file a scoped issue if needed.

Closing — conflicts with PR#1020 (DRY refactor) which was already merged. The error handling should be re-done on top of the new `_render_task_list()` helper. Will re-file a scoped issue if needed.
Some checks failed
Tests / lint (pull_request) Failing after 3s
Tests / test (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1003