Ensure we catch HTTP errors on upload/download. Fixes #752

This commit is contained in:
Matt Martz 2021-01-19 17:04:47 -06:00
parent c58ad3367b
commit db46af8bcd
No known key found for this signature in database
GPG Key ID: 40832D88E9FC91D8
1 changed files with 5 additions and 1 deletions

View File

@ -817,6 +817,8 @@ class HTTPDownloader(threading.Thread):
f.close()
except IOError:
pass
except HTTP_ERRORS:
pass
class HTTPUploaderData(object):
@ -882,7 +884,7 @@ class HTTPUploader(threading.Thread):
self.request = request
self.request.data.start = self.starttime = start
self.size = size
self.result = None
self.result = 0
self.timeout = timeout
self.i = i
@ -917,6 +919,8 @@ class HTTPUploader(threading.Thread):
self.result = 0
except (IOError, SpeedtestUploadTimeout):
self.result = sum(self.request.data.total)
except HTTP_ERRORS:
self.result = 0
class SpeedtestResults(object):