From 8ca12dac278d58fa4486fc6d01a3de8b81fbe1ad Mon Sep 17 00:00:00 2001 From: Andy Haden Date: Mon, 23 Mar 2020 21:23:33 -0700 Subject: [PATCH] URLFile: include url in bad status code error --- common/url_file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/url_file.py b/common/url_file.py index 3c893ef5df..0e44b0e42f 100644 --- a/common/url_file.py +++ b/common/url_file.py @@ -72,7 +72,8 @@ class URLFile(object): if response_code == 416: # Requested Range Not Satisfiable return "" if response_code != 206 and response_code != 200: - raise Exception("Error {}: {}".format(response_code, repr(dats.getvalue())[:500])) + raise Exception("Error {} ({}): {}".format(response_code, self._url, repr(dats.getvalue())[:500])) + ret = dats.getvalue() self._pos += len(ret)