-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
2,627 additions
and
1,114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This file configures the initialization of Sentry on the client. | ||
// The config you add here will be used whenever a users loads a page in their browser. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
Sentry.init({ | ||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, | ||
|
||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. | ||
tracesSampleRate: 1, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). | ||
// The config you add here will be used whenever one of the edge features is loaded. | ||
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
Sentry.init({ | ||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, | ||
|
||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. | ||
tracesSampleRate: 1, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This file configures the initialization of Sentry on the server. | ||
// The config you add here will be used whenever the server handles a request. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
Sentry.init({ | ||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, | ||
|
||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. | ||
tracesSampleRate: 1, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as Sentry from "@sentry/nextjs"; | ||
import Error from "next/error"; | ||
|
||
const CustomErrorComponent = (props) => { | ||
return <Error statusCode={props.statusCode} />; | ||
}; | ||
|
||
CustomErrorComponent.getInitialProps = async (contextData) => { | ||
// In case this is running in a serverless function, await this in order to give Sentry | ||
// time to send the error before the lambda exits | ||
await Sentry.captureUnderscoreErrorException(contextData); | ||
|
||
// This will contain the status code of the response | ||
return Error.getInitialProps(contextData); | ||
}; | ||
|
||
export default CustomErrorComponent; |
Oops, something went wrong.