@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
import * as Sentry from '@sentry/nextjs'
|
||||
import { NextPageContext } from 'next'
|
||||
import NextErrorComponent from 'next/error'
|
||||
|
||||
const CustomErrorComponent = (props: {
|
||||
@@ -31,7 +32,7 @@ const CustomErrorComponent = (props: {
|
||||
return <NextErrorComponent statusCode={props.statusCode} />
|
||||
}
|
||||
|
||||
CustomErrorComponent.getInitialProps = async (contextData: any) => {
|
||||
CustomErrorComponent.getInitialProps = async (contextData: NextPageContext) => {
|
||||
// In case this is running in a serverless function, await this in order to give Sentry
|
||||
// time to send the error before the lambda exits
|
||||
await Sentry.captureUnderscoreErrorException(contextData)
|
||||
|
||||
Reference in New Issue
Block a user