aboutsummaryrefslogtreecommitdiff
path: root/ext/js/templates/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/templates/sandbox')
-rw-r--r--ext/js/templates/sandbox/template-renderer-frame-api.js9
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