-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Add runtime tags to Next.js errors #3327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
49387a2
build: Remove unused @sentry/minimal package
iker-barriocanal e589d10
ref: Remove unused args and code
iker-barriocanal 18ef214
feat: Capture exceptions if `Error`, otherwise capture message
iker-barriocanal 1639cbf
feat: Set runtime tag
iker-barriocanal 3d2ffe1
fix: Reference correct variable
iker-barriocanal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { withScope, captureException } from '@sentry/nextjs'; | ||
|
||
export default async function onErrorClient({ err, errorInfo, renderErrorProps, data, version }) { | ||
// TODO: Extract some useful metadata from the router and other arguments — Kamil | ||
import { withScope, captureException, captureMessage } from '@sentry/nextjs'; | ||
|
||
export default async function onErrorClient({ err }) { | ||
withScope(scope => { | ||
if (typeof errorInfo?.componentStack === 'string') { | ||
scope.setContext('react', { | ||
componentStack: errorInfo.componentStack.trim(), | ||
}); | ||
if (err instanceof Error) { | ||
captureException(err); | ||
} else { | ||
captureMessage(err.message); | ||
} | ||
captureException(err); | ||
}); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -3276,16 +3276,6 @@ | |
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" | ||
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.2.1.tgz#f9f277e6f8cad0c7efd1a01726095d63a47a1c16" | ||
integrity sha512-OAikFZ9EimD3noxMp8tA6Cf6qJcQ2U8k5QSgTPwdx+09nZOGJzbRFteK7WWmrS93ZJdzN61lpSQbg5v+bmmfbQ== | ||
dependencies: | ||
"@sentry/core" "6.2.1" | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/cli@^1.52.4", "@sentry/cli@^1.58.0": | ||
version "1.63.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.63.0.tgz#e69f05e2abab3c68a68958b55556618067e1dea9" | ||
|
@@ -3297,96 +3287,6 @@ | |
progress "^2.0.3" | ||
proxy-from-env "^1.1.0" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.2.1.tgz#8b177e9bf591e2e7ddcb04f0b1403de3f5aa8755" | ||
integrity sha512-jPqQEtafxxDtLONhCbTHh/Uq8mZRhsfbwJTSVYfPVEe/ELfFZLQK7tP6rOh7zEWKbTkE0mE6XcaoH3ZRAhgrqg== | ||
dependencies: | ||
"@sentry/hub" "6.2.1" | ||
"@sentry/minimal" "6.2.1" | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.2.1.tgz#35bc6bf841a93f4354b3a17592c938b3dba20b73" | ||
integrity sha512-pG7wCQeRpzeP6t0bT4T0X029R19dbDS3/qswF8BL6bg0AI3afjfjBAZm/fqn1Uwe/uBoMHVVdbxgJDZeQ5d4rQ== | ||
dependencies: | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-6.2.1.tgz#caa9b49de29523698668d45827633be86b2268ff" | ||
integrity sha512-UBvuil/b9M5HGH6aBDzTiIVRsmpC/wqwDKy28IO05XLdalmKgJ9C1EQhoyN6xw+1lINpXXFtfq4NhfgZgWbc7Q== | ||
dependencies: | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
localforage "^1.8.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.2.1.tgz#8f01480e1b56bc7dd54adf925e5317f233e19384" | ||
integrity sha512-wuSXB4Ayxv9rBEQ4pm7fnG4UU2ZPtPnnChoEfd4/mw1UthXSvmPFEn6O4pdo2G8fTkl8eqm6wT/Q7uIXMEmw+A== | ||
dependencies: | ||
"@sentry/hub" "6.2.1" | ||
"@sentry/types" "6.2.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.2.1.tgz#111418d2cc2245512bc5e46786c373d7d5202525" | ||
integrity sha512-JlixtJHS6xMzh2G4Pz7oMM8Nd40mGUALQYtuGMwW2QE3IduOaaGsn1+eVpN6PwZetMnvRIn6VVFOc2UmFIzWpA== | ||
dependencies: | ||
"@sentry/core" "6.2.1" | ||
"@sentry/hub" "6.2.1" | ||
"@sentry/tracing" "6.2.1" | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
cookie "^0.4.1" | ||
https-proxy-agent "^5.0.0" | ||
lru_map "^0.3.3" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.2.1.tgz#26587f3f47e9699003b04ac558d8aa8a2b7416d7" | ||
integrity sha512-emJnYVASM2hej2f8eSjqiDRMljwLsDJDSwa6kVc5HUOs9gnVrE4MR+vSywraACf5tKZbH1YI+NUXCmR++fIB0g== | ||
dependencies: | ||
"@sentry/browser" "6.2.1" | ||
"@sentry/minimal" "6.2.1" | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
hoist-non-react-statics "^3.3.2" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.2.1.tgz#61c18c43c5390c348b35dafe73947ab379252d8f" | ||
integrity sha512-bvStY1SnL08wkSeVK3j9K5rivQQJdKFCPR2VYRFOCaUoleZ6ChPUnBvxQ/E2LXc0hk/y/wo1q4r5B0dfCCY+bQ== | ||
dependencies: | ||
"@sentry/hub" "6.2.1" | ||
"@sentry/minimal" "6.2.1" | ||
"@sentry/types" "6.2.1" | ||
"@sentry/utils" "6.2.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.2.1.tgz#28c946230b2023f72307b65606d32052ad9e5353" | ||
integrity sha512-h0OV1QT+fv5ojfK5/+iEXClu33HirmvbjcQC2jf05IHj9yXIOWy6EB10S8nBjuLiiFqQiAQYj3FN9Ip4eN8NJA== | ||
|
||
"@sentry/[email protected]": | ||
version "6.2.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.2.1.tgz#bfcb12c20d44bf2aeb0073b1264703c11c179ebd" | ||
integrity sha512-6kQgM/yBPdXu+3qbJnI6HBcWztN9QfiMkH++ZiKk4ERhg9d2LYWlze478uTU5Fyo/JQYcp+McpjtjpR9QIrr0g== | ||
dependencies: | ||
"@sentry/types" "6.2.1" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/webpack-plugin@^1.14.1": | ||
version "1.14.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.14.1.tgz#f7aceac17820677f6064293d1f5d01ac72012d14" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.