diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index 3c2f66d037..442c5d388d 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -66,11 +66,7 @@ class AuthorizationService: # \sa _parseJWT def getUserProfile(self) -> Optional["UserProfile"]: if not self._user_profile: - try: - self._user_profile = self._parseJWT() - except requests.exceptions.ConnectionError: - # Unable to get connection, can't login. - return None + self._user_profile = self._parseJWT() if not self._user_profile and self._auth_data: # If there is still no user profile from the JWT, we have to log in again. diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py index adff94bbbc..87c7a50838 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py @@ -159,9 +159,13 @@ class CloudApiClient: model: Type[CloudApiClientModel], ) -> None: def parse() -> None: + # Don't try to parse the reply if we didn't get one + if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) is None: + return status_code, response = self._parseReply(reply) self._anti_gc_callbacks.remove(parse) - return self._parseModels(response, on_finished, model) + self._parseModels(response, on_finished, model) + return self._anti_gc_callbacks.append(parse) reply.finished.connect(parse)