mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 18:49:01 +08:00
Catch type errors when trying to populate models from API response
This commit is contained in:
parent
f517beba76
commit
669fb39f40
@ -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:
|
except (JSONDecodeError, TypeError):
|
||||||
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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user