Catch Sentry errors so that archived version works

This commit is contained in:
Jordan Eldredge 2020-02-03 08:23:33 -08:00
parent 6dce525272
commit 1f1b7aa229

View file

@ -80,11 +80,17 @@ function filterBreadcrumbActions(action) {
return !noisy;
}
Sentry.init({
dsn: SENTRY_DSN,
/* global COMMITHASH */
release: typeof COMMITHASH !== "undefined" ? COMMITHASH : "DEV",
});
try {
Sentry.init({
dsn: SENTRY_DSN,
/* global COMMITHASH */
release: typeof COMMITHASH !== "undefined" ? COMMITHASH : "DEV",
});
} catch (e) {
// Archive.org tries to rewrite the DSN to point to a archive.org version
// since it looks like a URL. When this happens, Sentry crashes.
console.error(e);
}
const sentryMiddleware = createMiddleware(Sentry, {
filterBreadcrumbActions,