mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 17:55:52 +01:00
improvements to error logging in frontend
This commit is contained in:
@@ -406,7 +406,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
notes = JSON.parse(jsonStr);
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`Cannot parse ${jsonStr} into notes for drop`);
|
||||
logError(`Cannot parse ${jsonStr} into notes for drop`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
|
||||
if (!resolvedNotePathSegments) {
|
||||
if (logErrors) {
|
||||
console.error("Could not find run path for notePath:", notePath);
|
||||
logError("Could not find run path for notePath:", notePath);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -1152,11 +1152,17 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
async setExpanded(branchId, isExpanded) {
|
||||
utils.assertArguments(branchId);
|
||||
|
||||
const branch = treeCache.getBranch(branchId);
|
||||
const branch = treeCache.getBranch(branchId, true);
|
||||
|
||||
if (!branch) {
|
||||
// in case of virtual branches there's nothing to update
|
||||
return;
|
||||
if (branchId && branchId.startsWith('virt')) {
|
||||
// in case of virtual branches there's nothing to update
|
||||
return;
|
||||
}
|
||||
else {
|
||||
logError(`Cannot find branch=${branchId}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
branch.isExpanded = isExpanded;
|
||||
|
||||
@@ -539,7 +539,7 @@ export default class RelationMapTypeWidget extends TypeWidget {
|
||||
const note = this.mapData.notes.find(note => note.noteId === noteId);
|
||||
|
||||
if (!note) {
|
||||
console.error(`Note ${noteId} not found!`);
|
||||
logError(`Note ${noteId} not found!`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user