From 35e3f12afaceb6f3b3d4ee6b7e7111e3f6dd941a Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 31 May 2018 16:53:04 -0700 Subject: [PATCH] fix(workers): swallow errors when auto-detaching from page subtargets (#2649) Page subtargets (e.g. out-of-process iframes and others) sometimes die before we send the 'detach' command. This is harmless to us, but we shouldn't have an unhandled promise rejection in this case. Example crash: https://cirrus-ci.com/task/4884032470908928 --- lib/Page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Page.js b/lib/Page.js index 345d426ee0b..e4871717b97 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -97,7 +97,7 @@ class Page extends EventEmitter { // If we don't detach from service workers, they will never die. client.send('Target.detachFromTarget', { sessionId: event.sessionId - }); + }).catch(debugError); return; } const session = client._createSession(event.targetInfo.targetId, event.sessionId);