Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling in parameter operations #347

Open
MaxGhenis opened this issue Feb 28, 2025 · 0 comments · May be fixed by #348
Open

Improve error handling in parameter operations #347

MaxGhenis opened this issue Feb 28, 2025 · 0 comments · May be fixed by #348

Comments

@MaxGhenis
Copy link
Contributor

The parameter operations module has several areas where error handling could be improved:

  1. In , there are bare except blocks that catch all exceptions, making debugging difficult.
  2. The error messages aren't specific enough about what went wrong or how to fix it.
  3. Generic ValueError exceptions are used instead of specific error types.

Proposed Solution

Create a new class that:

  • Includes the full parameter path that was requested
  • Specifies exactly which part of the path failed
  • Provides better guidance for bracket syntax errors
  • Suggests similar parameter names when there's a near match

This will make debugging parameter-related issues much easier for users and developers.

Related files:

MaxGhenis added a commit to MaxGhenis/policyengine-core that referenced this issue Feb 28, 2025
- Improve error handling in get_parameter with detailed error messages
- Add suggestions for parameter names when a parameter isn't found
- Add comprehensive error messages for bracket syntax errors

Fixes PolicyEngine#347

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
@MaxGhenis MaxGhenis linked a pull request Feb 28, 2025 that will close this issue
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 a pull request may close this issue.

1 participant