From 669fb39f40a85eac8f3b739903c3a3c4f30f22c6 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 9 Sep 2019 10:44:17 +0200 Subject: [PATCH] Catch type errors when trying to populate models from API response --- plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py index 951b69977d..f61982b9a8 100644 --- a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py +++ b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py @@ -135,7 +135,7 @@ class ClusterApiClient: result = model_class(**response) # type: ClusterApiClientModel on_finished_item = cast(Callable[[ClusterApiClientModel], Any], on_finished) on_finished_item(result) - except JSONDecodeError: + except (JSONDecodeError, TypeError): Logger.log("e", "Could not parse response from network: %s", str(response)) ## Creates a callback function so that it includes the parsing of the response into the correct model.