Replace generic exceptions with rich error messages and "did you mean?" suggestions#948
Merged
Replace generic exceptions with rich error messages and "did you mean?" suggestions#948
Conversation
- Replace ValueError in paths/algorithms.py with AlgorithmError + did-you-mean - Replace ValueError in centrality/robustness.py with helpful parameter suggestions - Replace ValueError/FileNotFoundError in workflows.py with rich Py3plex exceptions - Add comprehensive tests for improved error messages - All 86 exception tests passing Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
- Replace ValueError in temporal_utils.py with ParsingError + format hints - Replace ValueError in attribute_correlation.py with AlgorithmError/NetworkConstructionError - Add tests for temporal and attribute correlation errors - All 88 exception tests passing Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve error logs with constructive suggestions
Replace generic exceptions with rich error messages and "did you mean?" suggestions
Dec 25, 2025
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.
Replaced basic Python exceptions (ValueError, FileNotFoundError) with domain-specific exceptions that provide constructive suggestions, typo detection, and actionable guidance across 5 high-traffic modules.
Changes
Path algorithms (
paths/algorithms.py)Robustness centrality (
centrality/robustness.py)Workflow configuration (
workflows.py)Temporal utilities (
temporal_utils.py)Attribute correlation (
algorithms/attribute_correlation.py)Example
Before:
After:
Uses existing Rust-style error infrastructure from
exceptions.pyanderrors.py. Added 12 tests validating improvements (88 total passing).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.