mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
Move error to Errors
This commit is contained in:
parent
2748249217
commit
ba22111ff4
|
@ -483,6 +483,7 @@ class Errors:
|
|||
E199 = ("Unable to merge 0-length span at doc[{start}:{end}].")
|
||||
|
||||
# TODO: fix numbering after merging develop into master
|
||||
E952 = ("The section '{name}' is not a valid section in the provided config.")
|
||||
E953 = ("Mismatched IDs received by the Tok2Vec listener: {id1} vs. {id2}")
|
||||
E954 = ("The Tok2Vec listener did not receive a valid input.")
|
||||
E955 = ("Can't find table '{table}' for language '{lang}' in spacy-lookups-data.")
|
||||
|
|
|
@ -1121,9 +1121,8 @@ def dot_to_object(config: Config, section: str):
|
|||
for item in parts:
|
||||
try:
|
||||
component = component[item]
|
||||
except (KeyError, TypeError) as e:
|
||||
msg = f"The section '{section}' is not a valid section in the provided config."
|
||||
raise KeyError(msg)
|
||||
except (KeyError, TypeError):
|
||||
raise KeyError(Errors.E952.format(name=section))
|
||||
return component
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user