mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
feat: support sentry report (#1729)
This commit is contained in:
15
apps/web/src/pages/_error.tsx
Normal file
15
apps/web/src/pages/_error.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user