log single request error

This commit is contained in:
TheBeastLT
2021-09-15 13:02:06 +02:00
committed by TheBeastLT
parent f9ffaebb88
commit a8eae80888
4 changed files with 13 additions and 6 deletions

View File

@@ -25,7 +25,10 @@ function torrent(torrentId, config = {}, retries = 2) {
return singleRequest(`${baseUrl}/${slug}/`, config)
.then((body) => parseTorrentPage(body))
.then((torrent) => torrent.map(el => ({ torrentId: slug, ...el })))
.catch((err) => torrent(slug, config, retries - 1));
.catch((err) => {
console.warn(`Failed ComoEuBaixo ${slug} request: `, err);
return torrent(slug, config, retries - 1)
});
}
function search(keyword, config = {}, retries = 2) {