Skip to content

Commit

Permalink
fix: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TopETH committed Jul 19, 2024
1 parent 3bf5582 commit 6f2d844
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/webapp/app/(routes)/[lang]/blog/[category]/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ export default async function sitemap(
const {
params: { lang }
} = props
const sections = await getArticleSections(lang)
const categories = sections.map(section => section.slug)
let sections;
try {
sections = await getArticleSections(lang)
} catch(error) {
return [];
}

const categories = sections.map(section => section.slug)
return categories.map(category => ({
url: `${process.env.VERCEL_URL}/${lang}/blog/${category}`,
lastModified: new Date()
Expand Down

0 comments on commit 6f2d844

Please sign in to comment.