mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-05 18:48:31 +00:00
Rewrite stack traces for Sentry to use the static URL for the current FFZ build to make sure it uses correct source maps.
This commit is contained in:
parent
161b084626
commit
e9214bb46a
2 changed files with 12 additions and 6 deletions
|
@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
|
|||
FrankerFaceZ.Logger = Logger;
|
||||
|
||||
const VER = FrankerFaceZ.version_info = {
|
||||
major: 4, minor: 0, revision: 0, extra: '-beta2.18.2',
|
||||
major: 4, minor: 0, revision: 0, extra: '-beta2.18.3',
|
||||
build: __webpack_hash__,
|
||||
toString: () =>
|
||||
`${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${DEBUG ? '-dev' : ''}`
|
||||
|
|
16
src/raven.js
16
src/raven.js
|
@ -12,7 +12,9 @@ import Module from 'utilities/module';
|
|||
|
||||
import Raven from 'raven-js';
|
||||
|
||||
const AVALON_REG = /\/(?:script|static)\/((?:babel\/)?avalon)(\.js)(\?|#|$)/;
|
||||
const AVALON_REG = /\/(?:script|static)\/((?:babel\/)?avalon)(\.js)(\?|#|$)/,
|
||||
fix_url = url => url.replace(AVALON_REG, `/static/$1.${__webpack_hash__}$2$3`);
|
||||
|
||||
|
||||
const BAD_URLS = [
|
||||
'hls.ttvnw.net',
|
||||
|
@ -186,6 +188,12 @@ export default class RavenLogger extends Module {
|
|||
data.extra = Object.assign(this.buildExtra(), data.extra);
|
||||
data.tags = Object.assign(this.buildTags(), data.tags);
|
||||
|
||||
if ( data.exception && Array.isArray(data.exception.values) )
|
||||
data.exception.values = this.rewriteStack(data.exception.values, data);
|
||||
|
||||
if ( data.culprit )
|
||||
data.culprit = fix_url(data.culprit);
|
||||
|
||||
if ( data.tags.example ) {
|
||||
if ( this.__example_waiter ) {
|
||||
this.__example_waiter(data);
|
||||
|
@ -195,14 +203,12 @@ export default class RavenLogger extends Module {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( data.exception && Array.isArray(data.exception.values) )
|
||||
data.exception.values = this.rewriteStack(data.exception.values, data);
|
||||
|
||||
return true;
|
||||
}
|
||||
}).install();
|
||||
}
|
||||
|
||||
|
||||
onEnable() {
|
||||
this.log.info('Installed error tracking.');
|
||||
}
|
||||
|
@ -214,7 +220,7 @@ export default class RavenLogger extends Module {
|
|||
continue;
|
||||
|
||||
for(const frame of err.stacktrace.frames)
|
||||
frame.filename = frame.filename.replace(AVALON_REG, `/static/$1.${__webpack_hash__}$2$3`)
|
||||
frame.filename = fix_url(frame.filename);
|
||||
}
|
||||
|
||||
return errors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue