Added error handling to loadEPG()
This commit is contained in:
parent
1d9cc3a185
commit
2372a27bc3
|
@ -72,10 +72,14 @@ async function main() {
|
||||||
|
|
||||||
const epgUrl = playlist.header.attrs['x-tvg-url']
|
const epgUrl = playlist.header.attrs['x-tvg-url']
|
||||||
if(epgUrl && !buffer[epgUrl] && parseEpg) {
|
if(epgUrl && !buffer[epgUrl] && parseEpg) {
|
||||||
|
try {
|
||||||
console.log(`Loading '${epgUrl}'...`)
|
console.log(`Loading '${epgUrl}'...`)
|
||||||
const epg = await util.loadEPG(epgUrl)
|
const epg = await util.loadEPG(epgUrl)
|
||||||
console.log(`Adding '${epgUrl}' to buffer...`)
|
console.log(`Adding '${epgUrl}' to buffer...`)
|
||||||
buffer[epgUrl] = epg
|
buffer[epgUrl] = epg
|
||||||
|
} catch(e) {
|
||||||
|
console.log(`Could not load '${epgUrl}'`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(buffer[epgUrl]) {
|
if(buffer[epgUrl]) {
|
||||||
|
|
Loading…
Reference in New Issue