From 2372a27bc3531fbb9943d085ffecbc37c9b199ab Mon Sep 17 00:00:00 2001 From: freearhey Date: Fri, 25 Oct 2019 23:37:42 +0300 Subject: [PATCH] Added error handling to loadEPG() --- helpers/format.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/helpers/format.js b/helpers/format.js index f315957ad..bf3c48dd0 100644 --- a/helpers/format.js +++ b/helpers/format.js @@ -72,10 +72,14 @@ async function main() { const epgUrl = playlist.header.attrs['x-tvg-url'] if(epgUrl && !buffer[epgUrl] && parseEpg) { - console.log(`Loading '${epgUrl}'...`) - const epg = await util.loadEPG(epgUrl) - console.log(`Adding '${epgUrl}' to buffer...`) - buffer[epgUrl] = epg + try { + console.log(`Loading '${epgUrl}'...`) + const epg = await util.loadEPG(epgUrl) + console.log(`Adding '${epgUrl}' to buffer...`) + buffer[epgUrl] = epg + } catch(e) { + console.log(`Could not load '${epgUrl}'`) + } } if(buffer[epgUrl]) {