Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(codebase): narrow broad except Exception to specific types across…#960

Closed
theonlychant wants to merge 1 commit into
amd:mainfrom
theonlychant:fix/narrow-exception-handlers
Closed

fix(codebase): narrow broad except Exception to specific types across…#960
theonlychant wants to merge 1 commit into
amd:mainfrom
theonlychant:fix/narrow-exception-handlers

Conversation

@theonlychant

Copy link
Copy Markdown
Contributor

Summary

Narrows broad except Exception catches to specific exception types
across 21 files, making errors surface loudly instead of being swallowed.

Why

CLAUDE.md requires "No Silent Fallbacks - Fail Loudly." Broad exception
catches hide real errors and make debugging harder. Each narrowing targets
the exact exception the code block can raise.

Linked issue

Refs #951

Changes

  • JSON parsing → except (ValueError, json.JSONDecodeError)
  • Numeric parsing → except ValueError
  • File IO → except OSError
  • Import-time → except ImportError
  • Network libs → their specific request/network exceptions

Test plan

  • python util/lint.py --all - no failures
  • pytest tests/unit/ - all passing

Checklist

  • I have linked a GitHub issue above.
  • I have described why this change is being made.
  • I have run linting and tests locally.
  • No behavior changes - only exception type narrowing.

@github-actions github-actions Bot added mcp MCP integration changes agents labels May 5, 2026
@theonlychant theonlychant deleted the fix/narrow-exception-handlers branch May 5, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents mcp MCP integration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant