🔧 Alex has good ideas

This commit is contained in:
Felix Rieseberg 2017-11-18 10:59:09 -08:00
parent cf7e9df3a0
commit 5b18bea7e3
2 changed files with 15 additions and 19 deletions

View file

@ -130,13 +130,9 @@ const asyncWebFrameMethods = function (requestId, method, callback, ...args) {
if (typeof callback === 'function') callback(result)
resolve(result)
} else {
if (error && error.__ELECTRON_SERIALIZED_ERROR__) {
let rehydratedError = error
if (errorConstructors[error.name]) {
rehydratedError = new errorConstructors[error.name](error.message)
rehydratedError.stack = error.stack
}
if (error.__ELECTRON_SERIALIZED_ERROR__ && errorConstructors[error.name]) {
const rehydratedError = new errorConstructors[error.name](error.message)
rehydratedError.stack = error.stack
reject(rehydratedError)
} else {