From 841e31b7e63c9eddabc5f2cf0b89a46dbf545b02 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 18 Apr 2019 17:38:19 -0700 Subject: [PATCH] feat: show underlying stack in errors in remote module (#17851) --- lib/browser/rpc-server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/browser/rpc-server.js b/lib/browser/rpc-server.js index 837180f3f7eb..922a647caa3e 100644 --- a/lib/browser/rpc-server.js +++ b/lib/browser/rpc-server.js @@ -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 }