Skip to content

Commit

Permalink
feat: show underlying stack in errors in remote module (#17851)
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon authored and codebytere committed Apr 19, 2019
1 parent ea6641a commit 841e31b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/browser/rpc-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ handleRemoteCommand('ELECTRON_BROWSER_FUNCTION_CALL', function (event, contextId
try {
return valueToMeta(event.sender, contextId, func(...args), true)
} catch (error) {
const err = new Error(`Could not call remote function '${func.name || 'anonymous'}'. Check that the function signature is correct. Underlying error: ${error.message}`)
const err = new Error(`Could not call remote function '${func.name || 'anonymous'}'. Check that the function signature is correct. Underlying error: ${error.message}\nUnderlying stack: ${error.stack}\n`)
err.cause = error
throw err
}
Expand Down Expand Up @@ -408,7 +408,7 @@ handleRemoteCommand('ELECTRON_BROWSER_MEMBER_CALL', function (event, contextId,
try {
return valueToMeta(event.sender, contextId, object[method](...args), true)
} catch (error) {
const err = new Error(`Could not call remote method '${method}'. Check that the method signature is correct. Underlying error: ${error.message}`)
const err = new Error(`Could not call remote method '${method}'. Check that the method signature is correct. Underlying error: ${error.message}\nUnderlying stack: ${error.stack}\n`)
err.cause = error
throw err
}
Expand Down

0 comments on commit 841e31b

Please sign in to comment.