ConfZ
ConfZ copied to clipboard
Wrap pydantic's validation error
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.