mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Fix crashing if QNetworkReply contains no status code
Display an appropriate message instead
This commit is contained in:
parent
8ff8a2292c
commit
3d2d651b73
1 changed files with 5 additions and 1 deletions
|
@ -108,7 +108,11 @@ class ToolPathUploader:
|
||||||
Logger.log("i", "Finished callback %s %s",
|
Logger.log("i", "Finished callback %s %s",
|
||||||
reply.attribute(QNetworkRequest.HttpStatusCodeAttribute), reply.url().toString())
|
reply.attribute(QNetworkRequest.HttpStatusCodeAttribute), reply.url().toString())
|
||||||
|
|
||||||
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) # type: int
|
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) # type: Optional[int]
|
||||||
|
if not status_code:
|
||||||
|
Logger.log("e", "Reply contained no status code.")
|
||||||
|
self._errorCallback(reply, None)
|
||||||
|
return
|
||||||
|
|
||||||
# check if we should retry the last chunk
|
# check if we should retry the last chunk
|
||||||
if self._retries < self.MAX_RETRIES and status_code in self.RETRY_HTTP_CODES:
|
if self._retries < self.MAX_RETRIES and status_code in self.RETRY_HTTP_CODES:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue