mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 17:21:35 +10:00
integrate sentry for error logging
This commit is contained in:
16
client/pages/_error.tsx
Normal file
16
client/pages/_error.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user