Update test.js

- fixes issue with error logging
- update console message
pull/2201/head^2
freearhey 4 years ago
parent 4f634b4768
commit b2eda1f755

@ -51,8 +51,7 @@ async function test() {
.catch(error => { .catch(error => {
if (error.response) { if (error.response) {
stats.failures++ stats.failures++
utils.writeToLog(country.url, error.message, channel.url) utils.writeToLog(item.url, error.message, channel.url)
console.log(`Error: ${error.message} '${channel.url}'`)
} }
}) })
} }
@ -62,7 +61,8 @@ async function test() {
console.log(`\nOK (${stats.playlists} playlists, ${stats.channels} channels)`) console.log(`\nOK (${stats.playlists} playlists, ${stats.channels} channels)`)
} else { } else {
console.log( console.log(
`\nFAILURES! (${stats.playlists} playlists, ${stats.channels} channels, ${stats.failures} failures)` `\nFAILURES! (${stats.playlists} playlists, ${stats.channels} channels, ${stats.failures} failures)
\n\nCheck the "error.log" file to see which links failed.`
) )
process.exit(1) process.exit(1)

Loading…
Cancel
Save