mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 15:16:28 +08:00
16 lines
541 B
TypeScript
16 lines
541 B
TypeScript
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;
|