From 154fffbb8dc465448881a6ded292181bda28f0ee Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 18 Sep 2020 06:03:04 +0200 Subject: [PATCH] properly handle yaml read errors --- Mystery.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Mystery.py b/Mystery.py index 399cb7ae..a22e44ea 100644 --- a/Mystery.py +++ b/Mystery.py @@ -220,8 +220,7 @@ def get_weights(path): with open(path, 'rb') as f: yaml = str(f.read(), "utf-8") except Exception as e: - print('Failed to read weights (%s)' % e) - return + raise Exception(f"Failed to read weights ({path})") from e return parse_yaml(yaml)