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

[New Feature] raise exception if config option checker fails #125

Open
qku opened this issue Nov 5, 2024 · 1 comment
Open

[New Feature] raise exception if config option checker fails #125

qku opened this issue Nov 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@qku
Copy link
Contributor

qku commented Nov 5, 2024

Feature Description

raise an exception during module loading if the checker of a config option returns False

Related Problem

current behavior if the checker returns False: the config option is not converted to its value but stays type ConfigOption. Usually this causes an exception to be raised once the module tries to do something with the config option. It is then difficult to understand what the original problem was.

Considered Alternatives

log a warning

Additional Context

No response

Contact Details

No response

@qku qku added the enhancement New feature or request label Nov 5, 2024
@Neverhorst
Copy link
Member

Hi @qku ,
yeah, checker has been barely used and was never properly implemented.

In the upcoming major release checker will be removed. There will be only constructor which can be used for any kind of type/value conversion as well as sanity checking by raising exceptions, e.g. ValueError.
In case of an exception in constructor for an optional ConfigOption the error will be logged and the meta variable will be intialized to its default value.

This should simplify things a bit and make the ConfigOption (and StatusVar) behaviour more predictable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants