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:
alannncandHariom Balhara authored and GitHub committed 2022-11-03 11:28:52 +00:00
1 parent b629333eb8
commit e6a5fe179b
10 files changed
+228 -15

No files matched your search

+4 -1
View File
@@ -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,