print debugging warning before raising error if model not properly initialized

This commit is contained in:
svlandeg 2020-10-01 09:21:00 +02:00
parent 5121972930
commit 6787e56315

View File

@ -970,7 +970,8 @@ class Language:
raise ValueError(Errors.E003.format(component=type(proc), name=name))
try:
doc = proc(doc, **component_cfg.get(name, {}))
except KeyError:
except KeyError as e:
warnings.warn(str(e))
raise ValueError(Errors.E109.format(name=name)) from None
if doc is None:
raise ValueError(Errors.E005.format(name=name))