Skip to content

Commit

Permalink
throw error when locale revalidation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed Oct 25, 2024
1 parent b90ffd4 commit 48226cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/api/revalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ export default async function handler(
console.log(`Revalidating ${localePath}`)
try {
await res.revalidate(localePath)
} catch (error) {
console.error(`Error revalidating ${localePath}:`, error)
} catch (err) {
console.error(`Error revalidating ${localePath}`, err)
throw new Error(`Error revalidating ${localePath}`)
}
})
)
Expand Down

0 comments on commit 48226cc

Please sign in to comment.