Skip to content

Replace bare exception fallbacks with specific logging#216

Merged
tirth8205 merged 1 commit intotirth8205:mainfrom
VaibhavDangaich:issue-194-specific-exception-logging
Apr 11, 2026
Merged

Replace bare exception fallbacks with specific logging#216
tirth8205 merged 1 commit intotirth8205:mainfrom
VaibhavDangaich:issue-194-specific-exception-logging

Conversation

@VaibhavDangaich
Copy link
Copy Markdown
Contributor

Fixes #194.

Summary

This PR replaces bare except Exception fallbacks in optional-path code with narrower exception handling and debug logging, while preserving the existing graceful fallback behavior.

What Changed

  • narrowed SQLite fallbacks in:
    • code_review_graph/graph.py
    • code_review_graph/wiki.py
    • code_review_graph/visualization.py
    • code_review_graph/migrations.py
    • code_review_graph/tools/context.py
  • narrowed parser/metadata/runtime fallbacks in:
    • code_review_graph/parser.py
    • code_review_graph/tsconfig_resolver.py
    • code_review_graph/registry.py
    • code_review_graph/cli.py
    • code_review_graph/eval/benchmarks/search_quality.py
  • added debug logging so optional failures are visible during debugging
  • kept the existing fallback return values such as {}, [], None, and "dev"

Tests

  • added tests/test_cli.py for _get_version() fallback logging
  • added logging/fallback coverage in tests/test_graph.py

Verification

  • ./.venv/bin/python -m pytest tests --tb=short -q
  • result: 618 passed, 5 skipped, 2 xpassed

Notes

This change is intentionally scoped to the issue-reported bare fallback handlers and does not alter existing except Exception as e paths that already log or return structured errors.

@tirth8205 tirth8205 force-pushed the issue-194-specific-exception-logging branch from 35b9d3e to 0bca4f0 Compare April 11, 2026 21:42
@tirth8205 tirth8205 merged commit 87d5265 into tirth8205:main Apr 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace bare except Exception with specific exception handling and logging

2 participants