Closed xoxys closed 5 years ago
Hi, thanks a lot for your report! I'll look into this asap and please wait for a while (maybe today).
No, problem. For me it could be a valid solution to use the build-in schema validation in a try... except block to handle possible merge errors more user-friendly. I will play a bit with this in the meantime :)
Because the types of the value of "logging" of the first one ({}) and the second one (None) does not match at all, I don't think it's possible to merge them automatically with the merge strategy MS_DICT (default).
logging:
level: WARNING # :: {}
logging: <None> # :: None, {} cannot be merged with None.
If you want to merge them, the appropriate strategy may be either MS_REPLACE or MS_NOREPLACE, or the second one should be rewritten such like:
logging: {}
I understand the issue and it's clear for me why this happends if merge strategy is MS_DICT but is there a way to get a better error handling for this case?
Catch TypeError might be the best way, I think.
If you have the following source file:
and try to merge this file with this:
you will get a TypeError Exception
TypeError: 'NoneType' object is not iterable
I understand the issue and it's clear for me why this habbends if merge strategy is
MS_DICT
but is there a way to get a better error handling for this case?