refactor: use error-utils for remote exception serialization / deserialization (#14788)

* refactor: use error-utils for remote exception serialization / deserialization

* fix internal process.type in sandboxed renderer
This commit is contained in:
Milan Burda 2018-09-26 07:44:55 +02:00 committed by Samuel Attard
parent 3df739fa89
commit b499d57cfd
4 changed files with 19 additions and 20 deletions

View file

@ -12,6 +12,7 @@ const { ipcMain, isPromise } = electron
const objectsRegistry = require('@electron/internal/browser/objects-registry')
const bufferUtils = require('@electron/internal/common/buffer-utils')
const errorUtils = require('@electron/internal/common/error-utils')
const hasProp = {}.hasOwnProperty
@ -138,9 +139,7 @@ const plainObjectToMeta = function (obj) {
const exceptionToMeta = function (sender, contextId, error) {
return {
type: 'exception',
message: error.message,
stack: error.stack || error,
cause: valueToMeta(sender, contextId, error.cause)
value: errorUtils.serialize(error)
}
}