diff --git a/examples/with-sentry/pages/_error.js b/examples/with-sentry/pages/_error.js index 003b2c873a255..fbfd32f507975 100644 --- a/examples/with-sentry/pages/_error.js +++ b/examples/with-sentry/pages/_error.js @@ -14,7 +14,7 @@ const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => { return } -MyError.getInitialProps = async ({ res, err, asPath }) => { +MyError.getInitialProps = async ({ res, err }) => { const errorInitialProps = await NextErrorComponent.getInitialProps({ res, err, @@ -48,13 +48,8 @@ MyError.getInitialProps = async ({ res, err, asPath }) => { } // If this point is reached, getInitialProps was called without any - // information about what the error might be. This is unexpected and may - // indicate a bug introduced in Next.js, so record it in Sentry - Sentry.captureException( - new Error(`_error.js getInitialProps missing data at path: ${asPath}`) - ) - await Sentry.flush(2000) - + // information about what the error might be. This can be caused by + // a falsy value being thrown e.g. throw undefined return errorInitialProps }