Fix download error reporting

Threaded downloads now
store the exception for passing
to the caller.

Change-Id: Ibe4a7a267b04a2775ad3775dd904a4e3c7520ebb
This commit is contained in:
Jarrod Johnson
2020-03-11 11:04:00 -04:00
parent daf2c36fb5
commit dd10bb7579
3 changed files with 9 additions and 1 deletions

View File

@@ -74,10 +74,14 @@ class FileDownloader(threading.Thread):
self.wc = webclient
self.url = url
self.savefile = savefile
self.exc = None
super(FileDownloader, self).__init__()
def run(self):
self.wc.download(self.url, self.savefile)
try:
self.wc.download(self.url, self.savefile)
except Exception as e:
self.exc = e
def get_upload_form(filename, data, formname, otherfields):