Skip to content

Commit 018b1d4

Browse files
committed
[templates] Reraise exception with new message
1 parent 1f37cfa commit 018b1d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

odml/templates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ def cache_load(url):
6767
if sys.version_info.major > 2:
6868
data = data.decode("utf-8")
6969
except (ValueError, URLError) as exc:
70-
print("Failed to load resource from '%s': %s" % (url, exc))
71-
raise
70+
msg = "Failed to load resource from '%s': %s" % (url, exc)
71+
exc.args = (msg,) # needs to be a tuple
72+
raise exc
7273

7374
with open(cache_file, "w") as local_file:
7475
local_file.write(str(data))

0 commit comments

Comments
 (0)