From 39f61fc41cb4065f675149595e106fd4d3018412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 9 Mar 2020 16:45:22 +0100 Subject: [PATCH] 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 3f2ee35ef..f2e8db79d 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); + } }); }