extensionSystem: Be saner at error handling
Use our native JS error system in the "extension system" API, only using the signal/log-based error reporting at the last mile. Additionally, delete the directory if loading the extension failed, and report the error back over DBus. https://bugzilla.gnome.org/show_bug.cgi?id=679099
This commit is contained in:
@ -111,7 +111,15 @@ function gotExtensionZipFile(session, message, uuid, callback, errback) {
|
||||
}
|
||||
|
||||
let extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
|
||||
ExtensionSystem.loadExtension(extension);
|
||||
|
||||
try {
|
||||
ExtensionSystem.loadExtension(extension);
|
||||
} catch(e) {
|
||||
uninstallExtensionFromUUID(uuid);
|
||||
errback('LoadExtensionError', e);
|
||||
return;
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user