[gnome-shell] extensionSystem: Handle all initExtension() extension errors
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionSystem: Handle all initExtension() extension errors
- Date: Mon, 17 Jul 2017 11:06:35 +0000 (UTC)
commit e845f4105aa4a8d72109794115c456acda9d17b0
Author: Florian Müllner <fmuellner gnome org>
Date: Thu May 18 00:03:28 2017 +0200
extensionSystem: Handle all initExtension() extension errors
The method currently catches errors that occur when calling the
extension's init() method, but throws itself an error if the
expected extension.js file is missing. The former is pointless
if we expect all callers to handle errors themselves anyway, and
we should avoid the latter if we don't - opt for the second option
and handle a missing extension.js file gracefully.
https://bugzilla.gnome.org/show_bug.cgi?id=781728
js/ui/extensionSystem.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index f25d63a..cf501da 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -218,8 +218,10 @@ function initExtension(uuid) {
throw new Error("Extension was not properly created. Call loadExtension first");
let extensionJs = dir.get_child('extension.js');
- if (!extensionJs.query_exists(null))
- throw new Error('Missing extension.js');
+ if (!extensionJs.query_exists(null)) {
+ logExtensionError(uuid, new Error('Missing extension.js'));
+ return false;
+ }
let extensionModule;
let extensionState = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]