Skip to content

Commit

Permalink
chore: fix code for ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangpeng2k committed Jan 9, 2025
1 parent a5e68da commit 2e740a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/routes/blizzard/news-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand All @@ -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(
Expand Down

0 comments on commit 2e740a5

Please sign in to comment.