fix(cli): graceful error for cycles, export, embed when no graph.db exists#79
fix(cli): graceful error for cycles, export, embed when no graph.db exists#79carlos-alm merged 1 commit intomainfrom
Conversation
Greptile SummaryFixed crashes in
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 1d822e7 |
1d822e7 to
3f56644
Compare
|
Claude finished @carlos-alm's task —— View job PR Review: Graceful Error Handling for Missing graph.dbTodo List:
Root Cause AnalysisProblem Being Solved: The Why This Approach: The fix standardizes error handling across CLI commands by:
Risk Assessment: Very Low Risk - This is a pure defensive fix that only adds error checking without changing core logic. Critical ConcernsNone found. This is a straightforward, well-implemented bug fix that: ✅ Fixes real crashes - Prevents Code Quality AssessmentExcellent implementation:
Technical correctness:
Test coverage verified:
Final Recommendation
This is exactly how error handling should be implemented in CLI tools. The consistency with existing |
Summary
codegraph cycles,codegraph export, andcodegraph embedcrashed with abetter-sqlite3stack trace when run without a graph.dbopenReadonlyOrFail()in cli.js and addingfs.existsSync()guard in embedder.js./package.jsonin the package exports map sorequire('@optave/codegraph/package.json')worksFound during
Dogfooding v2.2.3-dev.44e8146 — see #77 and #78
Test plan
codegraph cycleswithout graph → graceful error messagecodegraph exportwithout graph → graceful error messagecodegraph embedwithout graph → graceful error messagenpm testpasses (29/29 test files, 476/476 tests)npm run lintpasses (0 warnings)