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.

Rollbar not catching browser errors from throw

See original GitHub issue

To re-create:

Is this intentional? Am I missing a config flag that needs to be enabled? Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
brianrcommented, May 30, 2017

Hi @eschaefer - two things here I think:

  • That test won’t work in the Chrome console, since the console has its own exception handler. You can call window.onerror directly though: window.onerror("hello");
  • The lastError property appears to have been removed in 2.x. @rokob do you know if that was intentional?
0reactions
rokobcommented, Jun 20, 2017

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 to true should fix this issue. I will add back lastError to the Rollbar instance.

Read more comments on GitHub >

github_iconTop 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 >

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