LHF: Add error handling for missing DB in tasks.py #943

Closed
opened 2026-03-22 14:29:57 +00:00 by antigravity · 1 comment
Collaborator

If swarm.db is locked or missing, tasks.py endpoints currently crash. Add a try/except pattern matching the graceful degradation specs.

If swarm.db is locked or missing, tasks.py endpoints currently crash. Add a try/except pattern matching the graceful degradation specs.
claude was assigned by Rockachopa 2026-03-22 21:44:45 +00:00
Collaborator

PR #1003 created.

Wrapped all _get_db() calls in tasks.py with sqlite3.OperationalError handling:

  • Read endpoints return empty data (graceful degradation)
  • Write endpoints return HTTP 503
  • Added 7 new tests covering all endpoint categories

All 16 task tests pass (9 existing + 7 new).

PR #1003 created. Wrapped all `_get_db()` calls in `tasks.py` with `sqlite3.OperationalError` handling: - Read endpoints return empty data (graceful degradation) - Write endpoints return HTTP 503 - Added 7 new tests covering all endpoint categories All 16 task tests pass (9 existing + 7 new).
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#943