PolicyEngine / PolicyEngine/policyengine-core

Improve error handling in parameter operations

Open
#347 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
22
Forks
30
Avg merge
14h 33m
Merged PRs (30d)
7

Description

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the parameter operations module and inspect its bare exception handlers, generic ValueError uses, and existing parameter-path handling. Review how bracket syntax and near matches are currently handled; the work is done when errors identify the full path and failed segment, provide bracket-syntax guidance, and suggest near-matching parameter names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.