Propagate errors instead of swallowing them - #27
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Propagate errors instead of swallowing them#27devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Several failure paths were silently absorbed, so a broken run could still look like a clean report. This makes each of them either propagate or become visible (logged + surfaced in the CLI/report), without changing the happy path.
The worst offender: a file that failed to download was handed to the LLM as if it were source code.
CodeFetcher.fetch_eip_files()is the new entrypoint returningFetchOutcome(files, failures)and raisingCodeFetchErrorwhen nothing could be fetched;fetch_eip_implementation()keeps its oldDict[str, str]signature (successes only). The CLI prints one warning per skipped file.Other silent paths now surfaced:
SpecFetcher.fetch_eip_speccollectedwarnings(printed by the CLI) and raisesSpecFetchErrorwhen an EIP has registered spec sources but none could be fetched — previously the analysis quietly ran on EIP prose alone. OnlyHTTPError/ConnectionErrorwere caught before; timeouts escaped as unhandled crashes.ERRORAnalysisResultper file (that resilience is deliberate), but nowlogger.exceptionthe cause and carryerror="HTTPError: 500"into_dict(). Gemini returningresponse.text is Noneis treated as a failure rather than crashing inside the parser._parse_json_responselogs when it cannot recover JSON, and handles an empty response explicitly.failed_filesand reportANALYSIS FAILEDwhen every file errored — that used to be folded intoUNCERTAIN, i.e. a failed run presented as an inconclusive one.prspec analyzewarns per failed file and exits non-zero if all of them failed.verifier._one_roundandDifferentialEngine.synthesizekept theirexcept Exceptionfallbacks (they must not abort a run) but no longer discard the exception; a round backed by anERRORresult votesunsureinstead ofconfirm/refute.Config._load_configraisesConfigErroron unreadable/invalid YAML or a non-mapping document, instead of failing later withAttributeError: 'NoneType' object has no attribute 'get'.scan_pathreports skipped files (summary.files_skipped,errors[]) instead ofexcept OSError: continue.prspec fetch-spec|list-files|list-eips|clear-cache|check-configprinted an error and exited 0; they now abort with a non-zero status. Same forrun_demo.py, which returned early on failure and exited 0.except Exceptionaround imports/os.path.relpath), addedraise ... from eon re-raisedImportErrors, and guardedraise last_excwhenlast_exc is Nonein the Azure retry loop.New
src/errors.pyholdsPRSpecErrorand its subclasses (ConfigError,SpecFetchError,CodeFetchError,AnalysisError). CLI commands calllogging.basicConfigso the new warnings actually reach stderr (-vswitches to DEBUG).Testing
tests/test_error_handling.py(20 new tests) covers fetch failures being reported rather than inlined,CodeFetchError/SpecFetchError/ConfigError, unreadable-cache fallback,ANALYSIS FAILEDsummaries, verifier logging, andscan_pathskip reporting. Full suite: 169 passed, 2 skipped;ruff check src/ tests/ run_demo.pyclean.Link to Devin session: https://app.devin.ai/sessions/528d8fa6acfc4ddc88746ca656df33e4
Requested by: @Fosurero