1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-05 18:48:31 +00:00

Rewrite stack traces for Sentry to include the proper, static path to the current build to ensure that the correct source map is read by Sentry for displaying the exception.

This commit is contained in:
SirStendec 2018-04-16 18:56:42 -04:00
parent 0331799242
commit 547f50312e
3 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,8 @@
<div class="list-header">4.0.0-beta2.18.2<span>@a1a7fb774d62948bacc5</span> <time datetime="2018-04-16">(2018-04-16)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Rewrite stacktraces for automatic error reporting to use the permanent URL for the current FrankerFaceZ build.</li>
</ul>
<div class="list-header">4.0.0-beta2.18.1<span>@988ba86433ce4bfd636d</span> <time datetime="2018-04-15">(2018-04-15)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Changed: Add another filter for what sort of error logs we don't want from Apollo.</li>

View file

@ -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.1',
major: 4, minor: 0, revision: 0, extra: '-beta2.18.2',
build: __webpack_hash__,
toString: () =>
`${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${DEBUG ? '-dev' : ''}`

View file

@ -12,6 +12,8 @@ import Module from 'utilities/module';
import Raven from 'raven-js';
const AVALON_REG = /\/(?:script|static)\/((?:babel\/)?avalon)(\.js)(\?|#|$)/;
const BAD_URLS = [
'hls.ttvnw.net',
'trowel.twitch.tv',
@ -193,6 +195,9 @@ 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();
@ -203,6 +208,19 @@ export default class RavenLogger extends Module {
}
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 = frame.filename.replace(AVALON_REG, `/static/$1.${__webpack_hash__}$2$3`)
}
return errors;
}
buildExtra() {
const modules = {},
experiments = {},