summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-02-09 00:05:31 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-02-11 00:51:01 +0530
commitde16a0c030f3b224039e3ee544337f6d5cda803e (patch)
tree087332c3df0a8f0bf23096b8a1b77ccd73e7aad9
parentd5d0f6d46c2518de1faae5aee046ede62f4daca0 (diff)
cerbero/source: Make download failure exceptions usable
Now we print the original URL that failed to download, then a tuple of murl, exception so users can figure out what happened with the mirrors.
-rw-r--r--cerbero/utils/shell.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py
index e78911e3..20247e1b 100644
--- a/cerbero/utils/shell.py
+++ b/cerbero/utils/shell.py
@@ -449,10 +449,10 @@ def download(url, destination=None, check_cert=True, overwrite=False, logfile=No
try:
return download_func(murl, destination, check_cert, overwrite)
except Exception as ex:
- errors.append(ex)
+ errors.append((murl, ex))
if len(errors) == 1:
- raise errors[0]
- raise Exception (errors)
+ errors = errors[0]
+ raise FatalError('Failed to download {!r}: {!r}'.format(url, errors))
def _splitter(string, base_url):