feature/sentry.io for web (#5326)
* Initial commits that install sentry.io on web app * Updates yarn.lock * Update yarn.lock Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
1 parent
b629333eb8
commit
e6a5fe179b
10 files changed
+228
-15
No files matched your search
@@ -2,6 +2,7 @@
|
||||
* Typescript class based component for custom-error
|
||||
* @link https://nextjs.org/docs/advanced-features/custom-error-page
|
||||
*/
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import { NextPage, NextPageContext } from "next";
|
||||
import NextError, { ErrorProps } from "next/error";
|
||||
import React from "react";
|
||||
@@ -46,7 +47,9 @@ const CustomError: NextPage<CustomErrorProps> = (props) => {
|
||||
* Partially adapted from the example in
|
||||
* https://github.com/vercel/next.js/tree/canary/examples/with-sentry
|
||||
*/
|
||||
CustomError.getInitialProps = async ({ res, err, asPath }: AugmentedNextPageContext) => {
|
||||
CustomError.getInitialProps = async (ctx: AugmentedNextPageContext) => {
|
||||
const { res, err, asPath } = ctx;
|
||||
await Sentry.captureUnderscoreErrorException(ctx);
|
||||
const errorInitialProps = (await NextError.getInitialProps({
|
||||
res,
|
||||
err,
|
||||
|
||||
Reference in new issue
Block a user