1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-07 23:00:54 +00:00
* Fixed: Player sizing issue for Firefox users.
* Fixed: Errors rendering tool-tips for chat actions.
* Changed: Tweak parameters for automatic error reports to filter out more invalid error reports.
This commit is contained in:
SirStendec 2020-11-14 21:58:22 -05:00
parent b7a2ce3fcf
commit 32859318b2
8 changed files with 66 additions and 19 deletions

View file

@ -168,7 +168,8 @@ export default class RavenLogger extends Module {
'ChunkLoadError',
'SecurityError',
'QuotaExceededError',
'DataCloneError'
'DataCloneError',
'SyntaxError'
],
sanitizeKeys: [
/Token$/
@ -190,6 +191,7 @@ export default class RavenLogger extends Module {
return true;
},
shouldSendCallback: data => {
debugger;
if ( this.settings && ! this.settings.get('reports.error.enable') ) {
if ( data.tags && data.tags.example && this.__example_waiter ) {
this.__example_waiter(null);
@ -226,6 +228,22 @@ export default class RavenLogger extends Module {
if ( data.exception && Array.isArray(data.exception.values) )
data.exception.values = this.rewriteStack(data.exception.values, data);
if ( Array.isArray(data.stacktrace?.frames) ) {
let has_good = false;
for(const frame of data.stacktrace.frames) {
if ( frame.filename )
frame.filename = fix_url(frame.filename);
// If a stacktrace is nothing but wrapped/captured/anonymous
// then it's not very useful to us.
if ( frame.function && ! frame.function.includes('captureMessage') && ! frame.function.includes('captureException') && ! frame.function.includes('wrapped') && ! frame.function.includes('<anonymous>') )
has_good = true;
}
if ( ! has_good )
return false;
}
if ( data.culprit )
data.culprit = fix_url(data.culprit);
@ -287,13 +305,16 @@ export default class RavenLogger extends Module {
}
rewriteFrames(frames) { // eslint-disable-line class-methods-use-this
for(const frame of frames)
frame.filename = fix_url(frame.filename);
}
rewriteStack(errors) { // eslint-disable-line class-methods-use-this
for(const err of errors) {
if ( ! err || ! err.stacktrace || ! err.stacktrace.frames )
continue;
for(const frame of err.stacktrace.frames)
frame.filename = fix_url(frame.filename);
if ( Array.isArray(err?.stacktrace?.frames) )
this.rewriteFrames(err.stacktrace.frames);
}
return errors;