Errors inside raven swallow the original error
See original GitHub issueUsing raven-js
3.24.0 installed via npm, in Angular 5.
What is the current behavior?
If an error happens while reporting an event to sentry, raven blows up and throws an error in the console. For example, if I have origin filtering enabled on sentry and run my website locally, raven receives a 403 and swallows the original exception.
What is the expected behavior?
Raven should never do anything that prevents the real error from reaching termination, i.e. the application error should always be rethrown. If an error hapens in raven
code, it should be caught, logged and the app’s error be rethrown.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
The Raven | Explaining errors in Star Trek Wiki | Fandom
Murray Leeder on Sunday, December 20, 1998 - 10:39 pm: The problem is that the crew of Voyager DO NOT SEEM IN THE...
Read more >es6 promises swallow type errors - javascript - Stack Overflow
Using your second example, I get the following error in my console TypeError: Cannot set property 'otherthing' of undefined . · i want...
Read more >Facts about Crows - WDFW
Crows and ravens belong in the Corvid family. (which includes jays and magpies) and are considered to be among the most adaptable and...
Read more >Accidental aspiration/ingestion of foreign bodies in dentistry
Although anything introduced in the oral cavity can potentially lead to a mishap, the swallowing of some foreign objects is more common than...
Read more >Mnemonic Seed - A simple explanation of BIP39.
Encoding a random number in to words and using them to create a seed. ... First of all, we add a checksum to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, let’s dissect what’s happening here, as everything is working just fine, but manual rethrows make it look odd (ignore my previous comment, zone.js just made it harder to debug due to its “wrap everything i can” nature).
Raven.config().install()
handleError
methodRaven.captureException(err);
, it’s sent to sentry (403 is not that important here)throw err;
And now, what’s actually happening:
install()
you attach global error handlerscaptureException
inside yourhandleError
method, you capture it with RavenhandleError
method anymore, as it’s not in the bubble chain - what happens then, is that error is caught by globalonerror
handler that you attached usinginstall()
methodonerror
handler captures your rethrow and tries to send itallowDuplicates
option - https://docs.sentry.io/clients/javascript/config/)debug mode
as described in our docs (please note that previous method -Raven.debug = true
was broken in TypeScript which you use, so you can useRaven.config(DSN, { debug: true })
now with newest3.24.2
release as well)Here is how your console will look in various configurations (note that I used 401 [invalid dsn] to simulate 403 behavior - it will be the same).
Hopefully it makes everything much clearer. Let me know if you have any more questions.
Yeah, nice breakdown, @kamilogorek. I think that’ll serve readers for time to come, even for those without this exact issue.
One nitpick:
The docs say
This doesn’t tell me what I’m going to get. Will the debugging information be for me? For my users? For Raven.js developers? Should I avoid in production? Will it print the original error?
That last one is the reason I came to this thread. I was hoping for such an option.