diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-26 15:27:33 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-26 15:27:33 -0400 | 
| commit | f389b3c232bcdca685f3090975cd32932221f965 (patch) | |
| tree | f6b2e467ed1fc1337a8ddfa9ad01b51d155afe21 /ext/js | |
| parent | 8d1d428ed488bc38c65cef723b59d70032bc1dc0 (diff) | |
Fix missing error logging when logging debug info (#1758)
Diffstat (limited to 'ext/js')
| -rw-r--r-- | ext/js/display/display.js | 7 | 
1 files 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; |