From eba0f7720d58837accb9a1aad6909fce3496812f Mon Sep 17 00:00:00 2001 From: Elad Shaham <7040645+eshaham@users.noreply.github.com> Date: Fri, 24 May 2019 13:21:13 +0300 Subject: [PATCH] catch finish errors --- src/scrapers/base-scraper.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scrapers/base-scraper.js b/src/scrapers/base-scraper.js index c51f21b5..94105fc8 100644 --- a/src/scrapers/base-scraper.js +++ b/src/scrapers/base-scraper.js @@ -57,7 +57,11 @@ class BaseScraper { scrapeResult = loginResult; } - await this.terminate(); + try { + await this.terminate(); + } catch (e) { + scrapeResult = createGenericError(e.message); + } this.emitProgress(SCRAPE_PROGRESS_TYPES.END_SCRAPING); return scrapeResult;