mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
better logging and notifications on script errors for easier debugging
This commit is contained in:
@@ -5,10 +5,15 @@ const attributeService = require('../../services/attributes');
|
||||
const repository = require('../../services/repository');
|
||||
|
||||
async function exec(req) {
|
||||
const result = await scriptService.executeScript(req.body.script, req.body.params, req.body.startNoteId,
|
||||
req.body.currentNoteId, req.body.originEntityName, req.body.originEntityId);
|
||||
try {
|
||||
const result = await scriptService.executeScript(req.body.script, req.body.params, req.body.startNoteId,
|
||||
req.body.currentNoteId, req.body.originEntityName, req.body.originEntityId);
|
||||
|
||||
return { executionResult: result };
|
||||
return { success: true, executionResult: result };
|
||||
}
|
||||
catch (e) {
|
||||
return { success: false, error: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
async function run(req) {
|
||||
|
||||
Reference in New Issue
Block a user