chore: catch anything thrown out of a fetch
This commit is contained in:
parent
e9a615de0d
commit
1e25e460fc
7 changed files with 11 additions and 9 deletions
|
@ -5,9 +5,11 @@ module.exports = async function () {
|
|||
const url = 'https://oku.club/rss/collection/POaRa'
|
||||
const asset = new AssetCache('books_data')
|
||||
if (asset.isCacheValid('1h')) return await asset.getCachedValue()
|
||||
const res = await extract(url).catch((error) => {
|
||||
console.log(error.message)
|
||||
})
|
||||
const res = await extract(url)
|
||||
.catch((error) => {
|
||||
console.log(error.message)
|
||||
})
|
||||
.catch()
|
||||
const data = res.entries
|
||||
await asset.save(data, 'json')
|
||||
return data
|
||||
|
|
Reference in a new issue