1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Better error reporting for executing modules on the server

This commit is contained in:
Jeremy Ruston 2012-05-26 23:37:03 +01:00
parent 92353d37b2
commit a9f34b8b00

View File

@ -623,7 +623,11 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
$tw.modules.titles[name] = module;
// Execute it to get its exports if we haven't already done so
if(!module.exports) {
vm.runInNewContext(tiddler.fields.text,sandbox,tiddler.fields.title);
try {
vm.runInNewContext(tiddler.fields.text,sandbox,tiddler.fields.title);
} catch(e) {
throw "Error executing boot module " + tiddler.fields.title + ":\n" + e;
}
module.exports = sandbox.exports;
}
// Return the exports of the module