From 9e61fec00769d07a9ced11816f729d1bb8899ae1 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 6 Oct 2021 21:31:51 +0300 Subject: [PATCH] Update grab.js --- scripts/grab.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/grab.js b/scripts/grab.js index d05b9d4a..600df634 100644 --- a/scripts/grab.js +++ b/scripts/grab.js @@ -16,6 +16,7 @@ const options = program.opts() async function main() { console.log('Starting...') + console.time('Done in') const buffer = {} const channels = parseChannels(options.channels).filter(channel => { @@ -46,13 +47,16 @@ async function main() { .then(results => { programs = programs.concat(results) }) + .catch(err => { + console.log(` Error: ${err.message}`) + }) } const xml = grabber.convertToXMLTV({ channels, programs }) writeToFile(options.output, xml) console.log(`File '${options.output}' successfully saved`) - console.log('Finish') + console.timeEnd(`Done in`) return true }