error handling over whole apply statement

This commit is contained in:
leminlimez
2025-03-13 22:01:50 -04:00
parent dd978b4786
commit 6c229392e0

View File

@@ -286,6 +286,7 @@ class DeviceManager:
## APPLYING OR REMOVING TWEAKS AND RESTORING ## APPLYING OR REMOVING TWEAKS AND RESTORING
def apply_changes(self, resetting: bool = False, update_label=lambda x: None): def apply_changes(self, resetting: bool = False, update_label=lambda x: None):
try:
# set the tweaks and apply # set the tweaks and apply
# first open the file in read mode # first open the file in read mode
update_label("Applying changes to files...") update_label("Applying changes to files...")
@@ -413,7 +414,6 @@ class DeviceManager:
# restore to the device # restore to the device
update_label("Restoring to device...") update_label("Restoring to device...")
try:
restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld) restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
if tmp_pb_dir != None: if tmp_pb_dir != None:
tmp_pb_dir.cleanup() tmp_pb_dir.cleanup()