Skip to content

fix(dep-check): replace overly broad exception handling in main.py#130

Open
pshariat wants to merge 1 commit into
masterfrom
fix/dep-check-cli
Open

fix(dep-check): replace overly broad exception handling in main.py#130
pshariat wants to merge 1 commit into
masterfrom
fix/dep-check-cli

Conversation

@pshariat
Copy link
Copy Markdown

Fixing an issue where dependency check errors would be returned as MissingOptionErrors.

Ex:

venv/bin/dep_check check my_module --config local/dependency_config.yaml --unused error
ERROR:root:You have to write which feature you want to use among [build,check,graph]

The actual issue was that dependency_config.yaml was malformed: the MissingOptionError was very confusing.

Replace try/except KeyError blocks with explicit feature validation to prevent
masking runtime errors with misleading "invalid feature" error messages.
@pshariat pshariat requested review from a team and lumautomation as code owners February 17, 2026 09:58
Comment thread dep_check/main.py
Comment on lines +140 to +141
if self.feature not in DEP_CHECK_FEATURES:
raise MissingOptionError()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would this ever run if it's checked in the __init__ already ?

Comment thread tests/test_main.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this particular bug / piece of code is worth all these tests

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 this pull request may close these issues.

2 participants