-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Copy link
Labels
Package: nodeIssues related to the Sentry Node SDKIssues related to the Sentry Node SDK
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.26.0
Framework Version
Node v20.12.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
SDK setup:
Sentry.init({
dsn: process.env.SENTRY_DSN,
includeLocalVariables: true,
});
Steps to Reproduce
- init sentry with the above config
- throw an exception
- catch the exception in another file or function (eg. a parent function)
- re-throw the error
- capture the re-thrown error
Expected Result
The error is reported to sentry with its ORIGINAL variables from where in was first thrown
Actual Result
The error is reported with only some frames with variables or no variables at all.
I dug into this - the error hash of the re-throw will match the error hash of the original error, and so the local variable frame state will overridden by the re-throw when the worker sends the re-throw frames. But then the re-throw location's stack and vars will not necessarily match the original frame's stack (and the re-throw's frame length may not match the error's frame) so it will effectively just null out the variables.
Metadata
Metadata
Assignees
Labels
Package: nodeIssues related to the Sentry Node SDKIssues related to the Sentry Node SDK
Type
Projects
Status
No status