properly handle yaml read errors
This commit is contained in:
parent
036f821e52
commit
154fffbb8d
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue