mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 06:19:01 +08:00
Merge pull request #5363 from Ultimaker/backup-list-response-error-handling
Add extra validation to backup list response
This commit is contained in:
commit
3de9cab1e2
@ -54,7 +54,13 @@ class DriveApiService:
|
||||
Logger.log("w", "Could not get backups list from remote: %s", backup_list_request.text)
|
||||
Message(catalog.i18nc("@info:backup_status", "There was an error listing your backups."), title = catalog.i18nc("@info:title", "Backup")).show()
|
||||
return []
|
||||
return backup_list_request.json()["data"]
|
||||
|
||||
backup_list_response = backup_list_request.json()
|
||||
if "data" not in backup_list_response:
|
||||
Logger.log("w", "Could not get backups from remote, actual response body was: %s", str(backup_list_response))
|
||||
return []
|
||||
|
||||
return backup_list_response["data"]
|
||||
|
||||
def createBackup(self) -> None:
|
||||
self.creatingStateChanged.emit(is_creating = True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user