Skip to content

[AUDIT-006] Reduce bare except Exception patterns; add structured error handling #2168

Description

@groupthinking

[AUDIT-006] 800+ Bare Exception Handlers in src/ (🟠 HIGH)

Title: Reduce bare except Exception patterns; add structured error handling

Description:
Repository-wide search found ~800 except Exception / except: matches in src/, concentrated in:

  • src/youtube_extension/backend/services/*
  • src/youtube_extension/backend/api/*
  • src/agents/*

Impact: Failure opacity, difficult debugging, hidden errors

Files to Review:

  • src/youtube_extension/backend/services/ (all files)
  • src/youtube_extension/backend/api/ (all files)
  • src/agents/ (all files)

Required Actions:

  1. Audit critical paths (agents, routes, services) for bare exceptions
  2. Implement structured logging with failure reasons
  3. Add fail-closed patterns where appropriate (don't silent-fail on auth/security)
  4. Define exception handling standards doc

Acceptance Criteria:

  • All critical paths (auth, deployment, agents) use specific exceptions
  • Bare except: eliminated from critical paths
  • Failure reasons logged with context
  • Exception handling standards documented

Labels: 🟠 high, code-quality, logging, backend

Related: .github/AUDIT_FINDINGS_SESSION.md Section 6



Audit master doc: .github/AUDIT_FINDINGS_SESSION.md
Source session: https://github.com/groupthinking/EventRelay/tasks/36f6c3e5-60dc-4dfe-a151-ef2ab9114afa
Remediation phase: Phase 2: High (Weeks 2-4)

Cross-links: Previous: #2167 | Next: #2169 | Audit index: #2163

Activity

  1. linear-code commented on Sep 20, 2026

    @linear-code
    Contributor
  2. github-actions commented on Sep 20, 2026

    @github-actions
    Contributor

    👋 Thanks for opening this issue! It has been automatically labeled for triage.

  3. groupthinking commented on Sep 20, 2026

    @groupthinking
    OwnerAuthor

    Tracker: #2175

  4. 8 remaining items

  5. kk-agent commented on Sep 28, 2026

    @kk-agent
    Collaborator

    Max-aggressive cleanup 2026-09-28: EventRelay/UVAI product work is PARKED. Closing this stale/open item. Reopen if Hayden unparks the cut.

  6. groupthinking commented on Oct 8, 2026

    @groupthinking
    OwnerAuthor

    Reopened because parked was not remediated. Current-boundary repairs are in PR #2378: git add/commit failures no longer become successful deployment handoffs, identity lookup has typed failures and no fabricated owner, and absent deployment URL is a failure. Five injected failure tests passed without subprocess/network execution. Full agent/service critical-path audit remains open; documentation now names actual current paths.

  7. github-actions commented on Nov 9, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions