Skip to content

Commit

Permalink
don't fail on browser cleanup errors
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Feb 2, 2023
1 parent 8ac40cb commit 3b2977a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crawlerConductor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
}
Expand Down

0 comments on commit 3b2977a

Please sign in to comment.