From f389b3c232bcdca685f3090975cd32932221f965 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 26 Jun 2021 15:27:33 -0400 Subject: [PATCH] Fix missing error logging when logging debug info (#1758) --- ext/js/display/display.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 28659294..4148cd84 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -1961,10 +1961,10 @@ class Display extends EventDispatcher { for (const mode of modes) { let ankiNote; let ankiNoteException; - const ankiNoteErrors = []; + const errors = []; try { const noteContext = this._getNoteContext(); - ankiNote = await this._createNote(dictionaryEntry, mode, noteContext, false, ankiNoteErrors); + ankiNote = await this._createNote(dictionaryEntry, mode, noteContext, false, errors); } catch (e) { ankiNoteException = e; } @@ -1972,6 +1972,9 @@ class Display extends EventDispatcher { if (typeof ankiNoteException !== 'undefined') { entry.ankiNoteException = ankiNoteException; } + if (errors.length > 0) { + entry.errors = errors; + } ankiNotes.push(entry); } result.ankiNotes = ankiNotes;