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

Bug in @sentry/react-native Module with Error Handling Using String Cause #3673

Closed
Kobby-Bawuah opened this issue Mar 8, 2024 · 0 comments · Fixed by #4163
Closed

Bug in @sentry/react-native Module with Error Handling Using String Cause #3673

Kobby-Bawuah opened this issue Mar 8, 2024 · 0 comments · Fixed by #4163

Comments

@Kobby-Bawuah
Copy link

SDK version: (Assuming latest as not specified)

Are you using sentry.io or on-premise?
[ x] sentry.io (SaaS)

If you are using sentry.io, please post a link to your issue so we can take a look:


I have the following issue:

With regard to the @sentry/react-native SDK, a user reported that particularly within js/integrations/nativelinkederrors.js, there's a bug related to handling errors with a string cause. When an error is thrown with a string cause like so throw new Error("Error with string cause", { cause: "string cause" }), the SDK fails with a runtime error "right operand of 'in' is not an object", which seems to occur because the linkedError (the cause) is a string and not an object.

Steps to reproduce:
Step 1: Implement @sentry/react-native in a React Native project.
Step 2: Throw an error using throw new Error("Error with string cause", { cause: "string cause" }).

Actual result:

The SDK generates a runtime error stating "right operand of 'in' is not an object", failing to handle the error as expected.

Expected result:

The SDK should gracefully handle errors thrown with a string cause, without generating runtime errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants