From 1f1b7aa229a862ce6670e59d55275e6b79e176cc Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 3 Feb 2020 08:23:33 -0800 Subject: [PATCH] Catch Sentry errors so that archived version works --- demo/js/index.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/demo/js/index.js b/demo/js/index.js index 03ae7097..8e65e8b5 100644 --- a/demo/js/index.js +++ b/demo/js/index.js @@ -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,