integrate sentry for error logging

This commit is contained in:
Amruth Pillai
2022-11-24 11:21:30 +01:00
parent 0672988fff
commit be0b7f20f9
19 changed files with 748 additions and 169 deletions

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

@ -0,0 +1,16 @@
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) => {
return <NextErrorComponent statusCode={props.statusCode} />;
};
CustomErrorComponent.getInitialProps = async (contextData) => {
await Sentry.captureUnderscoreErrorException(contextData);
return NextErrorComponent.getInitialProps(contextData);
};
export default CustomErrorComponent;