silverwolf-x/project / packages /next /src /client /components /handle-isr-error.tsx
silverwolf-x's picture
download
raw
663 Bytes
const workAsyncStorage =
typeof window === 'undefined'
? (
require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')
).workAsyncStorage
: undefined
// if we are revalidating we want to re-throw the error so the
// function crashes so we can maintain our previous cache
// instead of caching the error page
export function handleISRError({ error }: { error: any }) {
if (workAsyncStorage) {
const store = workAsyncStorage.getStore()
if (store?.isStaticGeneration) {
if (error) {
console.error(error)
}
throw error
}
}
}

Xet Storage Details

Size:
663 Bytes
·
Xet hash:
76013ad05fe3bdd834771c498e95e903e554cf8e9ed2500f436c1c83c152c98c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.