This commit is contained in:
zadam
2020-08-15 00:06:26 +02:00
parent 121c819b79
commit 625483a8f2
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import ScriptContext from "./script_context.js";
import server from "./server.js";
import toastService from "./toast.js";
import treeCache from "./tree_cache.js";
async function getAndExecuteBundle(noteId, originEntity = null) {
const bundle = await server.get('script/bundle/' + noteId);
@@ -17,7 +18,9 @@ async function executeBundle(bundle, originEntity, $container) {
}.call(apiContext));
}
catch (e) {
toastService.showAndLogError(`Execution of ${bundle.noteId} failed with error: ${e.message}`);
const note = await treeCache.getNote(bundle.noteId);
toastService.showAndLogError(`Execution of JS note "${note.title}" with ID ${bundle.noteId} failed with error: ${e.message}`);
}
}