Skip to content

Replace crash with graceful error handling in ListRequirement.unsatis…#1999

Open
IB-Mustafa wants to merge 1 commit into
volatilityfoundation:developfrom
IB-Mustafa:fix/list-requirement-error-handling
Open

Replace crash with graceful error handling in ListRequirement.unsatis…#1999
IB-Mustafa wants to merge 1 commit into
volatilityfoundation:developfrom
IB-Mustafa:fix/list-requirement-error-handling

Conversation

@IB-Mustafa

@IB-Mustafa IB-Mustafa commented Jun 21, 2026

Copy link
Copy Markdown

What this fixes

There's an old TODO in ListRequirement.unsatisfied()
(volatility3/framework/configuration/requirements.py) about whether raising a TypeError is the right way to handle an invalid config value.

The problem

Most checks in this method fail gracefully — they log a message and return, letting the program continue safely. But one check (when the value isn't a list at all) instead raises a TypeError, which crashes the whole program. It seemed inconsistent with every other check right next to it.

The fix

Replaced the raise TypeError(...) with the same graceful pattern used elsewhere in the method — log it, then return {config_path: self} to mark the requirement as unsatisfied, instead of crashing.

How I tested it

I tested it manually with a small script: passed in a string where a list was expected, and confirmed that before the fix it raised a TypeError, and after the fix it returned a normal "unsatisfied" result without crashing — same as the other checks in the function.

Happy to add a formal test if that's preferred.

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.

1 participant