From bbbf9d4fba0d12f5eda6fa9094b82df5c0930cb6 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 13 Jul 2017 09:03:19 +0200 Subject: [PATCH] Throw error when no pasteInterval is configured --- src/scrapers/pastebin-com.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scrapers/pastebin-com.js b/src/scrapers/pastebin-com.js index 4136d3c..3310951 100644 --- a/src/scrapers/pastebin-com.js +++ b/src/scrapers/pastebin-com.js @@ -23,6 +23,10 @@ module.exports = function createPastebinComScraper(options = {}) { let knownPastes = []; let previousKnownPastes = []; + if (options.pasteInterval == null) { + throw new Error("A `pasteInterval` is required in the `pastebinCom` scraper configuration, but none was provided"); + } + debug(`Initializing with pasteInterval ${options.pasteInterval}, listInterval ${options.listInterval}, and listLimit ${options.listLimit}`); queue.define("fetchPaste", (task) => {