From b6c7e2e48f28c424d7fdd82fb548aeed0c23a33c Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 30 May 2024 06:25:03 +0200 Subject: [PATCH] error handling --- src/services/notes.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/services/notes.js b/src/services/notes.js index 80a3b8e84..581811863 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -458,13 +458,18 @@ function findIncludeNoteLinks(content, foundLinks) { } function findRelationMapLinks(content, foundLinks) { - const obj = JSON.parse(content); + try { + const obj = JSON.parse(content); - for (const note of obj.notes) { - foundLinks.push({ - name: 'relationMapLink', - value: note.noteId - }); + for (const note of obj.notes) { + foundLinks.push({ + name: 'relationMapLink', + value: note.noteId + }); + } + } + catch (e) { + log.error("Could not scan for relation map links: " + e.message); } }