fix(route): 东方财富研报被删除时的try catch (#12693)

* feat(route): add 东方财富研究报告

* feat(route): add 东方财富研究报告

* update: 东方财富研究报告文档

* feat(router): add 东方财富研究报告

* feat(router): add 东方财富研究报告

* fix:link add .jshtml suffix

* feat(route):add 东方财富网行业研究

* chore: data link

* fix(route): 东方财富研报被删除时的try catch

* fix(route): 东方财富研报被删除时的try catch
This commit is contained in:
飞飞鱼 2023-06-22 19:39:11 +08:00 committed by GitHub
parent 658535de38
commit 56f6038f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -38,11 +38,15 @@ module.exports = async (ctx) => {
const items = await Promise.all(
list.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const { data: response } = await got(item.link);
const $ = cheerio.load(response);
item.link = $('.pdf-link').attr('href');
item.description = $('.ctx-content').text();
return item;
try {
const { data: response } = await got(item.link);
const $ = cheerio.load(response);
item.link = $('.pdf-link').attr('href');
item.description = $('.ctx-content').text();
return item;
} catch (error) {
return item;
}
})
)
);