diff options
Diffstat (limited to 'test/test-anki-note-builder.js')
-rw-r--r-- | test/test-anki-note-builder.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test-anki-note-builder.js b/test/test-anki-note-builder.js index 45087134..2e4beb21 100644 --- a/test/test-anki-note-builder.js +++ b/test/test-anki-note-builder.js @@ -92,12 +92,15 @@ async function createVM() { _serializeError(error) { try { if (typeof error === 'object' && error !== null) { - return { + const result = { name: error.name, message: error.message, - stack: error.stack, - data: error.data + stack: error.stack }; + if (Object.prototype.hasOwnProperty.call(error, 'data')) { + result.data = error.data; + } + return result; } } catch (e) { // NOP |