mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:35:53 +08:00
Don't crash if the reply cannot be loaded
Fixes Sentry issue CURA-2RQ
This commit is contained in:
parent
8b2904ee3b
commit
71748bff8d
@ -651,8 +651,11 @@ class Toolbox(QObject, Extension):
|
|||||||
self.resetDownload()
|
self.resetDownload()
|
||||||
|
|
||||||
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200:
|
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200:
|
||||||
Logger.log("w", "Failed to download package. The following error was returned: %s",
|
try:
|
||||||
json.loads(reply.readAll().data().decode("utf-8")))
|
reply_error = json.loads(reply.readAll().data().decode("utf-8"))
|
||||||
|
except Exception as e:
|
||||||
|
reply_error = str(e)
|
||||||
|
Logger.log("w", "Failed to download package. The following error was returned: %s", reply_error)
|
||||||
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…
x
Reference in New Issue
Block a user