Skip to content
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

SentryError constructor fail with a TypeError if Object/Error prototype has been frozen #15214

Closed
3 tasks done
tomi opened this issue Jan 29, 2025 · 1 comment · Fixed by #15216
Closed
3 tasks done
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@tomi
Copy link

tomi commented Jan 29, 2025

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.52.0

Framework Version

'@sentry/node': 8.52.0

Link to Sentry event

https://n8nio.sentry.io/issues/6252828797/events/4dcec130b6a94456a6693fd4d81ffc89/?project=4508342481780736

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Freeze prototypes of global objects. Object.prototype and Error.prototype are probably enough
Object.freeze(Object.prototype)
Object.freeze(Error.prototype)
  1. Initialize sentry and add a beforeSend function that returns null
  2. Capture an error

Expected Result

No errors are thrown from Sentry code

Actual Result

This error is thrown and reported:

TypeError
Cannot assign to read only property 'name' of object 'Error: before send for type `error` returned `null`, will not send event.'

Please see the attached Sentry event link for more details

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 29, 2025
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Jan 29, 2025
@mydea
Copy link
Member

mydea commented Jan 29, 2025

hey, thanks for writing in! I will look into this, it seems to be caused by what we do in the SentryError class, maybe we can get rid of some of that behavior.

mydea added a commit that referenced this issue Jan 29, 2025
We did some funky stuff in there that does not seem necessary and can even lead to issues.

Fixes #15214.
mydea added a commit that referenced this issue Jan 29, 2025
We did some funky stuff in there that does not seem necessary and can even lead to issues.

Fixes #15214.
mydea added a commit that referenced this issue Jan 29, 2025
….name` on `SentryError` class (#15216)

We did some funky stuff in there that does not seem necessary and can
even lead to issues.

Fixes #15214.
mydea added a commit that referenced this issue Jan 29, 2025
…tor.name` on `SentryError` class

We did some funky stuff in there that does not seem necessary and can
even lead to issues.

Fixes #15214.
mydea added a commit that referenced this issue Jan 29, 2025
…tor.name` on `SentryError` class

We did some funky stuff in there that does not seem necessary and can
even lead to issues.

Fixes #15214.
mydea added a commit that referenced this issue Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
Archived in project
2 participants