question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unhandled promise rejections will not be caught by Sentry warning not working (only logging message)

See original GitHub issue

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? @sentry/react-native@3.4.3

Steps to Reproduce

Run the app.

Expected Result

There should be one of these logs from https://github.com/getsentry/sentry-react-native/blob/f916f2b3afbb9884f9037b8486539ca6cc8b327c/src/js/integrations/reactnativeerrorhandlers.ts#L141:

  • Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.
  • Unhandled promise rejections will be caught by Sentry.
  • Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.

Actual Result

No message in logs.

Replacing:

logger.warn("Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.");

by

setTimeout(() => console.warn("Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page."), 0);

solves the issue (setTimeout and console instead of logger are both required). Maybe the logger is not yet ready at this time…

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jer-sencommented, Jul 17, 2022

Still an issue!

1reaction
jer-sencommented, Nov 28, 2022

Not yet, and not in the coming days. Maybe you should close the issue and I will update you when I will have time to check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting for React Native | Sentry Documentation
Due to an issue with React Native's dependencies, unhandled promise rejections might not be correctly caught by Sentry. If the promise rejection handler...
Read more >
Unhandled Promise Rejections in Node.js - The Code Barbarian
js process with a non-zero exit code. This is why unhandled rejections can be so insidious. You might think you caught an error,...
Read more >
Serverless Sentry - Serverless Framework: Plugins
Warn if your Lambda function is low on memory. Reports unhandled promise rejections. Catched and reports uncaught exceptions. Serverless, Sentry and as well ......
Read more >
A Comprehensive Guide To Error Handling In Node.js
Errors happen in every application. Devs have to decide: do you write code to handle the error? Suppress it? Notify the user?
Read more >
Using Sentry - Expo Documentation
Unless enableInExpoDevelopment: true is set, all your dev/local errors will be ignored and only app releases will report errors to Sentry. You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found