mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Raise error from caught KeyError to preserve traceback
This commit is contained in:
parent
f758804401
commit
ae15c9de79
|
@ -973,8 +973,8 @@ class Language:
|
||||||
try:
|
try:
|
||||||
doc = proc(doc, **component_cfg.get(name, {}))
|
doc = proc(doc, **component_cfg.get(name, {}))
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
warnings.warn(str(e))
|
# This typically happens if a component is not initialized
|
||||||
raise ValueError(Errors.E109.format(name=name)) from None
|
raise ValueError(Errors.E109.format(name=name)) from e
|
||||||
if doc is None:
|
if doc is None:
|
||||||
raise ValueError(Errors.E005.format(name=name))
|
raise ValueError(Errors.E005.format(name=name))
|
||||||
return doc
|
return doc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user