properly handle yaml read errors

This commit is contained in:
Fabian Dill 2020-09-18 06:03:04 +02:00
parent 036f821e52
commit 154fffbb8d
1 changed files with 1 additions and 2 deletions

View File

@ -220,8 +220,7 @@ def get_weights(path):
with open(path, 'rb') as f: with open(path, 'rb') as f:
yaml = str(f.read(), "utf-8") yaml = str(f.read(), "utf-8")
except Exception as e: except Exception as e:
print('Failed to read weights (%s)' % e) raise Exception(f"Failed to read weights ({path})") from e
return
return parse_yaml(yaml) return parse_yaml(yaml)