mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 18:25:51 +01:00
client: Improve logging for some bundle errors
This commit is contained in:
@@ -3,6 +3,7 @@ import server from "./server.js";
|
||||
import toastService from "./toast.js";
|
||||
import froca from "./froca.js";
|
||||
import utils from "./utils.js";
|
||||
import { t } from "./i18n.js";
|
||||
|
||||
async function getAndExecuteBundle(noteId, originEntity = null, script = null, params = null) {
|
||||
const bundle = await server.post(`script/bundle/${noteId}`, {
|
||||
@@ -79,6 +80,18 @@ async function getWidgetBundlesByParent() {
|
||||
widgetsByParent.add(widget);
|
||||
}
|
||||
catch (e) {
|
||||
const noteId = bundle.noteId;
|
||||
const note = await froca.getNote(noteId);
|
||||
toastService.showPersistent({
|
||||
title: t("toast.bundle-error.title"),
|
||||
icon: "alert",
|
||||
message: t("toast.bundle-error.message", {
|
||||
id: noteId,
|
||||
title: note.title,
|
||||
message: e.message
|
||||
})
|
||||
});
|
||||
|
||||
logError("Widget initialization failed: ", e);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user