diff options
author | Jaime van Kessel <nallath@gmail.com> | 2019-05-16 16:48:09 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2019-05-16 16:48:09 +0300 |
commit | 1c9eab6b2bab3fce9fb3a0bd9efc47100bbdf87a (patch) | |
tree | bb636d3a1b2a866bbc318ecbdf550cca34b34c7e /cura/Backups | |
parent | 915e0e2047e466c17ae6754c9da1ba2a01166990 (diff) |
Prevent crashes when backup fails to be restored
Also add a bit of logging so that we know what / how it went wrong
Diffstat (limited to 'cura/Backups')
-rw-r--r-- | cura/Backups/Backup.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py index 399a4ea7b0..9ccdcaf64d 100644 --- a/cura/Backups/Backup.py +++ b/cura/Backups/Backup.py @@ -148,5 +148,9 @@ class Backup: Logger.log("d", "Removing current data in location: %s", target_path) Resources.factoryReset() Logger.log("d", "Extracting backup to location: %s", target_path) - archive.extractall(target_path) + try: + archive.extractall(target_path) + except PermissionError: + Logger.logException("e", "Unable to extract the backup due to permission errors") + return False return True |