mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -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:
|
def _downloadError(self, package_id: str, update: bool = False, reply: Optional["QNetworkReply"] = None, error: Optional["QNetworkReply.NetworkError"] = None) -> None:
|
||||||
if reply:
|
if reply:
|
||||||
|
try:
|
||||||
reply_string = bytes(reply.readAll()).decode()
|
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}")
|
Logger.error(f"Failed to download package: {package_id} due to {reply_string}")
|
||||||
self._package_manager.packageInstallingFailed.emit(package_id)
|
self._package_manager.packageInstallingFailed.emit(package_id)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue