diff --git a/lib/routes/blizzard/news-cn.ts b/lib/routes/blizzard/news-cn.ts index 59ff938a2121db..09570099a3d3cb 100644 --- a/lib/routes/blizzard/news-cn.ts +++ b/lib/routes/blizzard/news-cn.ts @@ -100,7 +100,7 @@ async function fetchDetail(item, category) { async function handler(ctx) { const category = ctx.req.param('category') || 'ow'; if (!categoryNames[category]) { - throw Error('Invalid category'); + throw new Error('Invalid category'); } const rootUrl = `https://${category}.blizzard.cn/news`; @@ -110,7 +110,7 @@ async function handler(ctx) { const list = getList(category, $); if (!list.length) { - throw Error('No news found'); + throw new Error('No news found'); } const items = await Promise.all(