mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Catch UnicodeDecodeErrors when parsing error messages from server
Stupid recursive errors. Fixes Sentry issue CURA-3VB.
This commit is contained in:
parent
64b29779ca
commit
b5e3479c1c
1 changed files with 4 additions and 1 deletions
|
@ -244,7 +244,10 @@ class PackageList(ListModel):
|
|||
|
||||
def _downloadError(self, package_id: str, update: bool = False, reply: Optional["QNetworkReply"] = None, error: Optional["QNetworkReply.NetworkError"] = None) -> None:
|
||||
if reply:
|
||||
reply_string = bytes(reply.readAll()).decode()
|
||||
try:
|
||||
reply_string = bytes(reply.readAll()).decode()
|
||||
except UnicodeDecodeError:
|
||||
reply_string = "<error message is corrupt too>"
|
||||
Logger.error(f"Failed to download package: {package_id} due to {reply_string}")
|
||||
self._package_manager.packageInstallingFailed.emit(package_id)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue