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

Wrap pydantic's validation error #13

Open
silvanmelchior opened this issue Oct 20, 2021 · 0 comments
Open

Wrap pydantic's validation error #13

silvanmelchior opened this issue Oct 20, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@silvanmelchior
Copy link
Collaborator

If validation of a config class fails, the exception is raised by pydantic and not touched by confz at all. At the same time, confz might raise exceptions if the config could not be loaded or merged in the first place (e.g. a missing config file). Thus, the user has to catch both exceptions to react accordingly.

An alternative would be if confz catches the error of pydantic and raises its own exception, inheriting from ConfZException. This would allow the user to only catch a single exception.

@silvanmelchior silvanmelchior added enhancement New feature or request good first issue Good for newcomers labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant