@sentry/wizard 1.2.15 → 1.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -1
- package/dist/NextJs/configs/_error.js +9 -5
- package/package.json +1 -1
- package/scripts/NextJs/configs/_error.js +9 -5
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
<br/>
|
|
6
6
|
<h1>Sentry Wizard</h1>
|
|
7
|
-
<h4>
|
|
7
|
+
<h4>The Sentry Wizard helps you set up your React Native, Cordova, Electron or Next.js projects with Sentry.</h4>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
[](https://www.npmjs.com/package/@sentry/wizard)
|
|
@@ -45,6 +45,8 @@ yarn sentry-wizard
|
|
|
45
45
|
npx @sentry/wizard
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
At the current moment, the wizard is meant to be used for React Native, Cordova, Electron or Next.js. If you have other platforms you would like the wizard to support, please open a [GitHub issue](https://github.com/getsentry/sentry-wizard/issues)!
|
|
49
|
+
|
|
48
50
|
# Options
|
|
49
51
|
|
|
50
52
|
```
|
|
@@ -14,16 +14,20 @@ const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
|
|
|
14
14
|
return <NextErrorComponent statusCode={statusCode} />;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
MyError.getInitialProps = async (
|
|
18
|
-
const errorInitialProps = await NextErrorComponent.getInitialProps(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
17
|
+
MyError.getInitialProps = async (context) => {
|
|
18
|
+
const errorInitialProps = await NextErrorComponent.getInitialProps(context);
|
|
19
|
+
|
|
20
|
+
const { res, err, asPath } = context;
|
|
22
21
|
|
|
23
22
|
// Workaround for https://github.com/vercel/next.js/issues/8592, mark when
|
|
24
23
|
// getInitialProps has run
|
|
25
24
|
errorInitialProps.hasGetInitialPropsRun = true;
|
|
26
25
|
|
|
26
|
+
// Returning early because we don't want to log 404 errors to Sentry.
|
|
27
|
+
if (res?.statusCode === 404) {
|
|
28
|
+
return errorInitialProps;
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
// Running on the server, the response object (`res`) is available.
|
|
28
32
|
//
|
|
29
33
|
// Next.js will pass an err on the server if a page's data fetching methods
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/wizard",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.16",
|
|
4
4
|
"homepage": "https://github.com/getsentry/sentry-wizard",
|
|
5
5
|
"repository": "https://github.com/getsentry/sentry-wizard",
|
|
6
6
|
"description": "Sentry wizard helping you to configure your project",
|
|
@@ -14,16 +14,20 @@ const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
|
|
|
14
14
|
return <NextErrorComponent statusCode={statusCode} />;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
MyError.getInitialProps = async (
|
|
18
|
-
const errorInitialProps = await NextErrorComponent.getInitialProps(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
17
|
+
MyError.getInitialProps = async (context) => {
|
|
18
|
+
const errorInitialProps = await NextErrorComponent.getInitialProps(context);
|
|
19
|
+
|
|
20
|
+
const { res, err, asPath } = context;
|
|
22
21
|
|
|
23
22
|
// Workaround for https://github.com/vercel/next.js/issues/8592, mark when
|
|
24
23
|
// getInitialProps has run
|
|
25
24
|
errorInitialProps.hasGetInitialPropsRun = true;
|
|
26
25
|
|
|
26
|
+
// Returning early because we don't want to log 404 errors to Sentry.
|
|
27
|
+
if (res?.statusCode === 404) {
|
|
28
|
+
return errorInitialProps;
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
// Running on the server, the response object (`res`) is available.
|
|
28
32
|
//
|
|
29
33
|
// Next.js will pass an err on the server if a page's data fetching methods
|