lay the ground work for sentry integration

This commit is contained in:
Amruth Pillai
2022-11-25 11:32:57 +01:00
parent 77c587681b
commit aec78cf875
15 changed files with 461 additions and 5 deletions

14
client/pages/_error.tsx Normal file
View File

@ -0,0 +1,14 @@
import * as Sentry from '@sentry/nextjs';
import type { NextPage } from 'next';
import type { ErrorProps } from 'next/error';
import NextErrorComponent from 'next/error';
const CustomErrorComponent: NextPage<ErrorProps> = (props) => <NextErrorComponent statusCode={props.statusCode} />;
CustomErrorComponent.getInitialProps = async (contextData) => {
await Sentry.captureUnderscoreErrorException(contextData);
return NextErrorComponent.getInitialProps(contextData);
};
export default CustomErrorComponent;