diff options
Diffstat (limited to 'ext/js/templates/sandbox/template-renderer-frame-api.js')
-rw-r--r-- | ext/js/templates/sandbox/template-renderer-frame-api.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/js/templates/sandbox/template-renderer-frame-api.js b/ext/js/templates/sandbox/template-renderer-frame-api.js index f234c8e0..af83425b 100644 --- a/ext/js/templates/sandbox/template-renderer-frame-api.js +++ b/ext/js/templates/sandbox/template-renderer-frame-api.js @@ -72,12 +72,15 @@ class TemplateRendererFrameApi { _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 |