mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -06:00
Fix crash when a corrupted and unkown message was returned
This is should be pretty rare, but we got a single crash report for it.
This commit is contained in:
parent
5f74ed080f
commit
42abece298
1 changed files with 6 additions and 2 deletions
|
@ -655,7 +655,11 @@ class Toolbox(QObject, Extension):
|
||||||
|
|
||||||
# Check if the download was sucessfull
|
# Check if the download was sucessfull
|
||||||
if self._download_reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200:
|
if self._download_reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200:
|
||||||
|
try:
|
||||||
Logger.log("w", "Failed to download package. The following error was returned: %s", json.loads(bytes(self._download_reply.readAll()).decode("utf-8")))
|
Logger.log("w", "Failed to download package. The following error was returned: %s", json.loads(bytes(self._download_reply.readAll()).decode("utf-8")))
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
Logger.logException("w", "Failed to download package and failed to parse a response from it")
|
||||||
|
finally:
|
||||||
return
|
return
|
||||||
# Must not delete the temporary file on Windows
|
# Must not delete the temporary file on Windows
|
||||||
self._temp_plugin_file = tempfile.NamedTemporaryFile(mode = "w+b", suffix = ".curapackage", delete = False)
|
self._temp_plugin_file = tempfile.NamedTemporaryFile(mode = "w+b", suffix = ".curapackage", delete = False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue