Also catch ValueError when handling modelParsing from network

CURA-6855
This commit is contained in:
Jaime van Kessel 2019-10-28 10:30:25 +01:00
parent 552b456a69
commit c5623a1364
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -135,7 +135,7 @@ class ClusterApiClient:
result = model_class(**response) # type: ClusterApiClientModel result = model_class(**response) # type: ClusterApiClientModel
on_finished_item = cast(Callable[[ClusterApiClientModel], Any], on_finished) on_finished_item = cast(Callable[[ClusterApiClientModel], Any], on_finished)
on_finished_item(result) on_finished_item(result)
except (JSONDecodeError, TypeError): except (JSONDecodeError, TypeError, ValueError):
Logger.log("e", "Could not parse response from network: %s", str(response)) 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. ## Creates a callback function so that it includes the parsing of the response into the correct model.