[gnome-shell] extensionSystem: Catch errors when updating extensions



commit 39f61fc41cb4065f675149595e106fd4d3018412
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Mar 9 16:45:22 2020 +0100

    extensionSystem: Catch errors when updating extensions
    
    Extension updates are installed at startup, so any errors that bubble
    up uncaught will prevent the startup to complete.
    
    While the most likely error reason was addressed in the previous commit
    (pending update for a no-longer exitent extension), it makes sense to
    catch any kind of corrupt updates to not interfere with shell startup.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/2343

 js/ui/extensionSystem.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 3f2ee35ef4..f2e8db79d2 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -489,9 +489,14 @@ var ExtensionManager = class {
             let extensionDir = Gio.File.new_for_path(
                 GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
 
-            FileUtils.recursivelyDeleteDir(extensionDir, false);
-            FileUtils.recursivelyMoveDir(dir, extensionDir);
-            FileUtils.recursivelyDeleteDir(dir, true);
+            try {
+                FileUtils.recursivelyDeleteDir(extensionDir, false);
+                FileUtils.recursivelyMoveDir(dir, extensionDir);
+            } catch (e) {
+                log('Failed to install extension updates for %s'.format(uuid));
+            } finally {
+                FileUtils.recursivelyDeleteDir(dir, true);
+            }
         });
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]