Custom exceptions throw globally aren't filtered by whitelistUrls
See original GitHub issueWhen 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:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top 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 >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
It already does? For normal exceptions (
Error
), at least. This changes it so that generic messages caught viacaptureMessage
will also applywhitelistUrls
(note that you needstacktrace:true
set in config).Hey @benvinegar, cool to see this fixed. Will
whitelistUrls
automatically start filtering global exceptions once we upgrade?