Skip to content

Commit 48226cc

Browse files
committed
throw error when locale revalidation fails
1 parent b90ffd4 commit 48226cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pages/api/revalidate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export default async function handler(
4141
console.log(`Revalidating ${localePath}`)
4242
try {
4343
await res.revalidate(localePath)
44-
} catch (error) {
45-
console.error(`Error revalidating ${localePath}:`, error)
44+
} catch (err) {
45+
console.error(`Error revalidating ${localePath}`, err)
46+
throw new Error(`Error revalidating ${localePath}`)
4647
}
4748
})
4849
)

0 commit comments

Comments
 (0)