Prevent a crash when retrying even though it completed in the meanwhile

Fixes Sentry issue CURA-NA.
This commit is contained in:
Ghostkeeper 2020-04-29 13:52:29 +02:00
parent bf3d6c67d9
commit dcac9b6a87
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -125,7 +125,10 @@ class ToolPathUploader:
if self._retries < self.MAX_RETRIES and status_code in self.RETRY_HTTP_CODES:
self._retries += 1
Logger.log("i", "Retrying %s/%s request %s", self._retries, self.MAX_RETRIES, reply.url().toString())
self._uploadChunk()
try:
self._uploadChunk()
except ValueError: # Asynchronously it could have completed in the meanwhile.
pass
return
# Http codes that are not to be retried are assumed to be errors.