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

Handle invalid config values individually with cleanup callback #42

Open
A248 opened this issue Aug 30, 2023 · 0 comments
Open

Handle invalid config values individually with cleanup callback #42

A248 opened this issue Aug 30, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@A248
Copy link
Owner

A248 commented Aug 30, 2023

If the format syntax is invalid, there's nothing we can do. However, if an individual config value is valid, developers might want to handle it in different ways.

The main behavior of DazzleConf is to fail-fast upon reaching the first invalid value. However, it should also be possible to substitute default values and log such substitutions. Moreover, we might benefit from collecting each invalid value, and including them in an exception message or logging about them all at once, so that users don't have to repeatedly reload their configuration and recheck for errors.

We should add an InvalidValueHandler which is allowed to create state per config load, with a cleanup callback after the configuration is finished loading. The default handler should be to fail but to collect all the invalid values first, with a reasonable limit on the number of invalid values to inform the user about in a single error message.

@A248 A248 added the enhancement New feature or request label Aug 30, 2023
@A248 A248 added this to the 2.0.0 milestone Aug 30, 2023
@A248 A248 changed the title Handle invalid config values individually with cleanup callback Handle invalid and missing config values individually with cleanup callback Aug 30, 2023
@A248 A248 changed the title Handle invalid and missing config values individually with cleanup callback Handle invalid config values individually with cleanup callback Aug 30, 2023
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

1 participant