Better error reporting for executing modules on the server

print-window-tiddler
Jeremy Ruston 2012-05-26 23:37:03 +01:00
rodzic 92353d37b2
commit a9f34b8b00
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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