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.

Custom exceptions throw globally aren't filtered by whitelistUrls

See original GitHub issue

When some third party code throws a non-Error object, it’s being collected by Raven’s window.onerror handler and being fowarded to captureMessage, which doesn’t use whitelistUrls to filter exceptions.

I’d expect that ALL global exceptions (that get caught by window.onerror) are passed through whitelistUrls, regardless of their type.

Code to reproduce:

  // Set up Raven:
  Raven.config('...', {
    whitelistUrls: [/myfile\.js/],
  });

  // Install window.onerror handler.
  Raven.install();

  setTimeout(function(){
     throw new Error('this will get filtered out by whitelistUrls since this isn\'t being thrown from that file');
  });

  CustomError = function(message) {
    this.message = message;
  };

  setTimeout(function(){
     throw new CustomError('this will make it through!');
  });

This is an issue if you’re including third party libraries on the page that might throw their own custom error object, and not catch it.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
benvinegarcommented, Aug 27, 2016

Will whitelistUrls automatically start filtering global exceptions once we upgrade to 3.4.0?

It already does? For normal exceptions (Error), at least. This changes it so that generic messages caught via captureMessage will also apply whitelistUrls (note that you need stacktrace:true set in config).

0reactions
wearherecommented, Aug 27, 2016

Hey @benvinegar, cool to see this fixed. Will whitelistUrls automatically start filtering global exceptions once we upgrade?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to manage exceptions thrown in filters in Spring?
So this is what I did: I read the basics about filters here and I figured out that I need to create a...
Read more >
Exception filters | NestJS - A progressive Node.js framework
Hint The global exception filter partially supports the http-errors library. Basically, any thrown exception containing the statusCode and message property ...
Read more >
Exception Clause - Apache Camel
Exception clauses is scoped as either: global (for Java DSL that is per RouteBuilder instances, to reuse, see note below). or route ......
Read more >
Configuration | Sentry Documentation
A function that allows filtering or mutating breadcrumb payloads. Return false to throw away the breadcrumb. JavaScript.
Read more >
Handle errors in ASP.NET Core | Microsoft Learn
To configure a custom error handling page for the Production environment, call UseExceptionHandler. This exception handling middleware:.
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