Skip to content

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

Closed
@tomi

Description

@tomi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions