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

try/catch TypeError hides bad settings kwargs passed directly to Unit #108

Closed
cboulay opened this issue Mar 21, 2024 · 1 comment
Closed

Comments

@cboulay
Copy link
Collaborator

cboulay commented Mar 21, 2024

In d87811c I made it so we could pass args and kwargs directly to the Unit initializer and these will be used to initialize the Unit's SETTINGS. However, if the kwargs are incorrect (e.g., typo), this raises a TypeError that gets swallowed by the try/catch block, and the unit ends up with no settings.

An easy solution is to scope the try/catch down to just the the final settings = self.__class__.__settings_type__() in the else condition in the if/else block.

@griffinmilsap
Copy link
Collaborator

Yeah, cool; your commit addresses this, and I can't fathom why this change would break anything. Another contribution I'd be happy to have in dev/main.

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

No branches or pull requests

2 participants