diff --git a/lib/runner/extensions/event.command.js b/lib/runner/extensions/event.command.js index 04d29e233..66a40a3d6 100644 --- a/lib/runner/extensions/event.command.js +++ b/lib/runner/extensions/event.command.js @@ -47,6 +47,7 @@ postProcessContext = function (execution, failures) { // function determines whe return undefined; } const serialisedError = require('serialised-error'); + return serialisedError(error, true); }; @@ -475,8 +476,8 @@ module.exports = { // instance once it is fully supported result && { cookies: result.cookies }); }).catch(function (err) { - const serialisedError = require('serialised-error'); - const error = serialisedError(err); + const serialisedError = require('serialised-error'), + error = serialisedError(err); delete error.stack; // remove stack to avoid leaking runtime internals this.host.dispatch(EXECUTION_RESPONSE_EVENT_BASE + id, requestId, error); @@ -528,6 +529,7 @@ module.exports = { // electron IPC does not bubble errors to the browser process, so we serialize it here. if (err) { const serialisedError = require('serialised-error'); + err = serialisedError(err, true); }