Skip to content

refactor(sova): audit and narrow 326 bare exception handlers #643

Description

@xsovad06

Objective

Audit the 326 except Exception: handlers across the codebase, replace with specific exception types where possible, and ensure all catch-all boundaries log with exc_info=True.

Findings

[P2] 326 bare except Exception: handlers

  • Location: Across all sova/ packages
  • Issue: Broad exception catching masks bugs and catches KeyboardInterrupt/SystemExit via chaining. Many are justified for non-fatal side effects, but the count makes it impossible to distinguish intentional from lazy handling.
  • Recommendation: Audit top 50 by file concentration. Replace with specific types (httpx.HTTPError, json.JSONDecodeError, etc.) where failure mode is known. Keep except Exception only for true catch-all boundaries.

Files to Modify

  • Top 50 files by except Exception: concentration (run grep -rc "except Exception:" sova/ | sort -t: -k2 -rn | head 50)

Estimated Effort

4 hours

Dependencies

#638 (Observability foundation)


Source: docs/HEALTH-AUDIT.md -- Health Audit 2026-08-12

Triage Assessment

Title: refactor(sova): audit and narrow 326 bare exception handlers
Has description: yes
Suitability: ready
Confidence: 85%
Complexity: complex
Missing context: none
Labels: type: task, area: sova

Issue has structured sections indicating clear scope; ready for research.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readyReady for autonomous developmentagent:triagedIssue triaged by SOVA agentarea: sovaSOVA Python framework (core)type: taskImplementation task

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions