Skip to content

Commit

Permalink
rewrite filenames in stacktraces without sub path, because sentry can…
Browse files Browse the repository at this point in the history
…not resolve the sourcemaps otherwise.

Do not upload transpiled files because we do not need them.
  • Loading branch information
peuter committed May 2, 2020
1 parent 4876dd1 commit b52ea7e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
export SENTRY_RELEASE=$(sentry-cli releases propose-version)
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
sentry-cli releases set-commits --auto $SENTRY_RELEASE
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps compiled/build --rewrite --strip-common-prefix --no-sourcemap-reference --ignore node_modules/ --ignore test/
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps compiled/build --rewrite --strip-common-prefix --no-sourcemap-reference --ignore node_modules/ --ignore test/ --ignore transpiled/
sentry-cli releases finalize $SENTRY_RELEASE
# - stage: deploy
# name: "[DOCS] - Generate and publish manual and API-viewer"
Expand Down
24 changes: 17 additions & 7 deletions source/boot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,24 @@
dsn: 'https://4346a6d6f24346f29ee3b408f51e0400@o178808.ingest.sentry.io/1265678',
release: 'ReleaseNotSetYet',
attachStacktrace: true,
beforeSend: function (ev) {
// Check if it is an exception -> Show report dialog (only in "de" or "en" language)
ev.exception && Sentry.showReportDialog({
lang: qx.locale.Manager.getInstance().getLanguage() === "de" ? qx.locale.Manager.getInstance().getLanguage() : "en"
});
beforeSend: function (data) {
var stacktrace = data.exception && data.exception.values[0].stacktrace;
var basePath = window.location.pathname;

if (stacktrace) {
if (stacktrace.frames) {
stacktrace.frames.forEach(function (frame) {
frame.filename = frame.filename.replace(basePath, "/");
});
}
// Show report dialog (only in "de" or "en" language)
Sentry.showReportDialog({
lang: qx.locale.Manager.getInstance().getLanguage() === "de" ? qx.locale.Manager.getInstance().getLanguage() : "en"
});
}
// overwrite release by the now known value
ev.release = cv.Version.REV;
return ev;
data.release = cv.Version.REV;
return data;
}
});
})
Expand Down

0 comments on commit b52ea7e

Please sign in to comment.