From 3b2977ad677eafff041e34c30ccf9cf106b9dd31 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Thu, 2 Feb 2023 14:30:55 +0000 Subject: [PATCH] don't fail on browser cleanup errors --- crawlerConductor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crawlerConductor.js b/crawlerConductor.js index e079e62e..594a2d66 100644 --- a/crawlerConductor.js +++ b/crawlerConductor.js @@ -72,8 +72,12 @@ async function crawlAndSaveData(urlString, dataCollectors, log, filterOutFirstPa dataCallback(url, data); } finally { if (driver && !VISUAL_DEBUG) { - await browserContext.browser().disconnect(); - await driver.quit(); + try { + await browserContext.browser().disconnect(); + await driver.quit(); + } catch (e) { + prefixedLog(chalk.red(`Could not clean up remote browser`), chalk.gray(e.message)); + } } } }