fix: catch OSError when Cargo.toml is missing during --cargo introspection#1428
Closed
DhruvTilva wants to merge 1 commit into
Closed
fix: catch OSError when Cargo.toml is missing during --cargo introspection#1428DhruvTilva wants to merge 1 commit into
DhruvTilva wants to merge 1 commit into
Conversation
Collaborator
|
Merged into |
Contributor
Author
Great @safishamsi |
safishamsi
added a commit
that referenced
this pull request
Jun 23, 2026
Query perf, a skill graph-health gate, and a batch of install/extraction fixes: - #1431 trigram query prefilter (faster, results unchanged) - #1437 Step 4.5 graph-health gate + semantic-cache anchored on the scan root - #1411 CUDA (.cu/.cuh) via the C++ extractor - #1402 cross-file type-annotation refs no longer duplicate nodes - #1403 hermes install -> %LOCALAPPDATA% on Windows - #1409 no punctuation-only Obsidian/Canvas filenames - #1413 opencode reminder backtick command-substitution fix - #1428 graphify extract --cargo handles missing Cargo.toml - #1429 prs.py F821 cleanup Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small, isolated fix: catches a missing-file error that currently crashes
--cargowith a raw traceback instead of a clean message. One-line change, no new behavior, no risk to existing functionality.Before:
--cargoon a missingCargo.tomlcrashes with a raw 10-line Python traceback — confusing for anyone who just typo'd a path.After: Same situation now exits with one clean line:
error: [Errno 2] No such file or directory: '...\Cargo.toml'— and exit code 1, so scripts/CI calling this still detect failure correctly.Problem
graphify extract <path> --cargoagainst a folder with noCargo.tomlthrows a raw, unhandledFileNotFoundErrorstraight at the user:FileNotFoundError: [Errno 2] No such file or directory: 'C:\path\Cargo.toml'
A typo'd path or running
--cargoone directory too high gets you a 10-line traceback instead of a sentence telling you what went wrong.Root cause
introspect_cargo()opensCargo.tomldirectly, so a missing file raisesFileNotFoundError— a subclass ofOSError. The call site in__main__.pyonly catchesConnectionErrorandImportError, so this one slips through uncaught.Testing
Cargo.toml→error: [Errno 2] No such file or directory: '...\Cargo.toml', exit code 1, no tracebackCargo.toml→ introspection still runs and extracts crate nodes exactly as beforepytest,ruff check,pyrightall green on the changed file