mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: show underlying stack in errors in remote module (#17851)
This commit is contained in:
committed by
Shelley Vohr
parent
ea6641afe5
commit
841e31b7e6
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user