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:
Jasper St. Pierre
2012-06-28 22:00:45 -04:00
parent 7949397958
commit c99e8eb29d
2 changed files with 48 additions and 58 deletions

View File

@ -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();
});
}