mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 23:16:47 +00:00
feat: propagate errors on iSSG failures instead of publishing public error pages
This commit is contained in:
@@ -14,14 +14,18 @@ export const getStaticProps = async (context) => {
|
||||
} catch (err) {
|
||||
console.error('page error', domain, rawPageId, err)
|
||||
|
||||
return {
|
||||
props: {
|
||||
error: {
|
||||
statusCode: err.statusCode || 500,
|
||||
message: err.message
|
||||
}
|
||||
}
|
||||
}
|
||||
// we don't want to publish the error version of this page, so
|
||||
// let next.js know explicitly that incremental SSG failed
|
||||
throw err
|
||||
|
||||
// return {
|
||||
// props: {
|
||||
// error: {
|
||||
// statusCode: err.statusCode || 500,
|
||||
// message: err.message
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,14 +11,18 @@ export const getStaticProps = async () => {
|
||||
} catch (err) {
|
||||
console.error('page error', domain, err)
|
||||
|
||||
return {
|
||||
props: {
|
||||
error: {
|
||||
statusCode: err.statusCode || 500,
|
||||
message: err.message
|
||||
}
|
||||
}
|
||||
}
|
||||
// we don't want to publish the error version of this page, so
|
||||
// let next.js know explicitly that incremental SSG failed
|
||||
throw err
|
||||
|
||||
// return {
|
||||
// props: {
|
||||
// error: {
|
||||
// statusCode: err.statusCode || 500,
|
||||
// message: err.message
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
export default function NotionDomainPage(props) {
|
||||
|
||||
Reference in New Issue
Block a user