-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignoreErrors not working #6100
Comments
@kamilogorek does raven-node even support this? I’m going to close the ticket here at any rate since it’s on the wrong repository. See https://github.com/getsentry/raven-node |
@mattrobenolt it doesn't, |
@mattrobenolt @kamilogorek My apologizes, I confused |
@vcarel they will be 1:1 compatible, we're working on it :) |
@kamilogorek Any update on this feature ? |
@mhd999 we're in the process of creating next major version of JS SDK – getsentry/sentry-javascript#1149 |
I've written a custom helper for this based on code found in raven-js, you can use it to support Helper: /**
* Join an array of string/regex patterns into a single regex (adapted from raven-js)
*/
function joinRegex(patterns) {
//Initialize sources
const sources = [];
//Loop patterns
for (const pattern of patterns) {
//If it's a string, we need to escape it
if (typeof pattern === 'string') {
sources.push(pattern.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'));
}
//If it's a regular expression already, we want to extract the source
else if (pattern && pattern.source) {
sources.push(pattern.source);
}
//Intentionally skip other cases
}
//Return combined regular expression
return new RegExp(sources.join('|'), 'i');
} Configuration converter: if (Array.isArray(cfg.ignoreErrors) && cfg.ignoreErrors.length > 0) {
const ignoreErrors = joinRegex(cfg.ignoreErrors);
cfg.shouldSendCallback = function(data) {
if (data.message && typeof data.message.match === 'function') {
return !data.message.match(ignoreErrors);
}
return true;
};
} This essentially defines a |
I'm trying to make
ignoreErrors
work, and I can't figure how.I'm using express with the following setup:
When I make a request to http://myserver/boom, Sentry captures the error.
I tried
/BOOM/
and/.*BOOM.*/
forignoreErrors
. The error is always sent.I'm on raven@2.1.2
The text was updated successfully, but these errors were encountered: