Comments (7)
Aaaaaghr... I again misread that its raven-js issue. @eladhaz05 for now, please use shouldSendCallback
for this purpose.
@adamchainz I totally agree. We are in the process of unifying all JS SDKs and it soon won't be an issue. It'll take a while, but we'll get there soon :)
from raven-node.
I've written a custom helper for this based on code found in raven-js, you can use it to support ignoreErrors
while waiting for the SDK's to be unified.
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 shouldSendCallback
config property if you've passed ignoreErrors
instead.
from raven-node.
Can you please provide an event that should but is not matching this errors filter?
You can gather them using
Raven.config('__DSN__', {
dataCallback: function (event) {
console.log(JSON.stringify(event, null, 2));
}
})
Cheers!
from raven-node.
I don't think the ignoreErrors
configuration exists for the Node client.
It's not documented at all, and #202 implies it has never been built.
I too would prefer support for ignoreErrors
though, because it's easier for admins to add lines to simple configuration like that instead of messing with a callback. It's also not documented what format data
has that is passed to shouldSendCallback
.
from raven-node.
you @'d the wrong adam
from raven-node.
Haha, sorry @adamchainz! And thanks for letting me know 🤦♂️
cc @adamreisnz
from raven-node.
Hah, similar names :)
@kamilogorek great to hear, look forward to a unified SDK!
from raven-node.
Related Issues (20)
- setUserContext Missing/Removed? HOT 1
- Stacktrace is showing compiled code and not the original source. HOT 8
- setExtraContext is not a function HOT 1
- Organisation prefixed npm package versions not shown HOT 2
- Warn/throw when using `captureException` without config HOT 2
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected HOT 7
- it is better to add reason in this code HOT 1
- Sourcemaps were uploaded but Sentry displays only generated JavaScript code HOT 15
- Do not omit non-standard ports in request url HOT 1
- Using raven-node within an Electron renderer process HOT 1
- `captureException` mutates (not merges) and does not send original `context` when first argument is not an Error instance HOT 1
- Circular/infinite loop encountered when passing model instance in `context` of `captureException` call that contains a circular reference HOT 5
- Add ability to clear breadcrumbs HOT 2
- Also report node version(s) HOT 2
- Extract arbitrary attributes from original request object. HOT 1
- Causing expensive memory costs by using JSON.parse in 2.5.0 HOT 3
- Raven Is Assuming Errors Created From vm is not proper Error and ignore it's stack trace. HOT 8
- Write consoleAlerts to stderr HOT 2
- Feature Request | Allow Multiple Raven Instances HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raven-node.