Rollbar not catching browser errors from throw
See original GitHub issueTo re-create:
- Go to http://stage-mywings.redbull.com.
- Open console, type
throw new Error('test')
, hit enter. - Type
window.Rollbar.lastError
, hit enter. - See nothing.
Is this intentional? Am I missing a config flag that needs to be enabled? Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to Catch (and Fix) JavaScript TypeErrors - Rollbar
Depending on the browser where the error got thrown the message can be different. Other messages that mean the same thing: TypeError: Unable...
Read more >Javascript (Browser & Node.js) - Rollbar Docs
Rollbar.js supports the ability to catch and report unhandled Promise rejections, that is, Promise failures that do not have a corresponding .then( ...
Read more >Browser JS - Rollbar Docs
If you're on Firefox, window.onerror is not accessible from the console, so you'll need to try this in your code instead: setTimeout(function ...
Read more >Javascript Error Tracking with Rollbar
JavaScript errors are tracked by Rollbar instantly as they occur. Get notified of errors and how to fix them throughout the software development...
Read more >How to Handle Exceptions in JavaScript - Rollbar
While this is relatively simplistic in terms of error handling, ... as every exception thrown will be caught—not just built-in ...
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 Free
Top 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
Hi @eschaefer - two things here I think:
window.onerror("hello");
lastError
property appears to have been removed in 2.x. @rokob do you know if that was intentional?The way exceptions work inside most Promise implementations is to get turned into Promise rejections. To have Rollbar catch these and report them, we provide the configuration option
captureUnhandledRejections
, setting this totrue
should fix this issue. I will add back lastError to the Rollbar instance.