mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
remove circular references when reporting to sentry
This commit is contained in:
parent
0ff5f54bf6
commit
edc83b905c
1 changed files with 6 additions and 0 deletions
|
@ -107,6 +107,12 @@ html(itemscope, itemtype='http://schema.org/Product')
|
|||
// only send a fraction of errors
|
||||
var sampleRate = 1.00;
|
||||
return (Math.random() <= sampleRate);
|
||||
},
|
||||
dataCallback: function(data) {
|
||||
// remove circular references from object
|
||||
var cache = [];
|
||||
var s = JSON.stringify(data, function(k, v) { if (typeof v === 'object' && v !== null) { if (cache.indexOf(v) !== -1) return "[circular]"; cache.push(v); }; return v; });
|
||||
return JSON.parse(s);
|
||||
}
|
||||
// we highly recommend restricting exceptions to a domain in order to filter out clutter
|
||||
// whitelistUrls: ['example.com/scripts/']
|
||||
|
|
Loading…
Reference in a new issue