feat: support sentry report (#1729)

This commit is contained in:
Himself65
2023-03-28 14:06:16 -05:00
committed by GitHub
parent c87aad436f
commit c9318d3790
9 changed files with 349 additions and 19 deletions

View File

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