konradhalas / dacite

Simple creation of data classes from dictionaries.
MIT License
1.76k stars 106 forks source link

KeyError exception in type hook may be eaten by dacite #140

Closed bnorick closed 3 years ago

bnorick commented 3 years ago

If a type hook raises a KeyError and its corresponding field has a default value, then it will be eaten by dacite in the try/except block here and the default value will be used.

In reality, the user probably needs to know that their type hook failed rather than resorting to the default value for the field silently.