Commit dcbf5e75 authored by Myle Ott's avatar Myle Ott
Browse files

Raise FileNotFoundError if dictionary files don't exist

parent fa508492
...@@ -113,6 +113,8 @@ class Dictionary(object): ...@@ -113,6 +113,8 @@ class Dictionary(object):
try: try:
with open(f, 'r', encoding='utf-8') as fd: with open(f, 'r', encoding='utf-8') as fd:
return Dictionary.load(fd) return Dictionary.load(fd)
except FileNotFoundError as fnfe:
raise fnfe
except: except:
raise Exception("Incorrect encoding detected in {}, please " raise Exception("Incorrect encoding detected in {}, please "
"rebuild the dataset".format(f)) "rebuild the dataset".format(f))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment