diff --git a/lib/routes/gov/zhengce/govall.js b/lib/routes/gov/zhengce/govall.js index 3d717a175..519444c03 100644 --- a/lib/routes/gov/zhengce/govall.js +++ b/lib/routes/gov/zhengce/govall.js @@ -36,9 +36,14 @@ module.exports = async (ctx) => { if (value) { description = value; } else { - const contentData = await got.get(href); - const $content = cheerio.load(contentData.data); - description = $content('#UCAP-CONTENT').html(); + try { + const contentData = await got.get(href); + const $content = cheerio.load(contentData.data); + description = $content('#UCAP-CONTENT').html(); + } catch (error) { + description = '文章已被删除'; + } + ctx.cache.set(key, description); }