From 6a0627a4119991c95d134fc4aeeecb2e1d2b5baa Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Fri, 25 May 2018 16:44:25 -0700 Subject: [PATCH] fix(page): Don't report clientside error with a node stack attached (#2572) This patch stops reporting node.js stacks as part of `pageerror` event. --- lib/Page.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Page.js b/lib/Page.js index 169c8123faa..eb881dd2d1e 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -461,7 +461,9 @@ class Page extends EventEmitter { */ _handleException(exceptionDetails) { const message = helper.getExceptionMessage(exceptionDetails); - this.emit(Page.Events.PageError, new Error(message)); + const err = new Error(message); + err.stack = ''; // Don't report clientside error with a node stack attached + this.emit(Page.Events.PageError, err); } async _onConsoleAPI(event) {