Skip to content

Commit

Permalink
Remove the front end lost 404 logging check
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed Feb 23, 2024
1 parent 1d63bfa commit a67ce11
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions apps/accounts/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
window.sentryOnLoad = function () {
Sentry.init({
dsn: "{{ sentry.dsn }}",
// This should be updated with each release.
// TODO: Is there a way to automate this?
release: "{{ sentry.release }}",
integrations: [
Sentry.browserTracingIntegration(),
Expand All @@ -37,30 +35,11 @@
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
};

// Adding this code from Sentry's docs to capture resource loading errors.
// https://docs.sentry.io/platforms/javascript/troubleshooting/#capturing-resource-404s
document.body.addEventListener(
"error",
(event) => {
if (!event.target) return;

if (event.target.tagName === "IMG") {
Sentry.captureMessage(
`Failed to load image: ${event.target.src}`,
"warning"
);
} else if (event.target.tagName === "LINK") {
Sentry.captureMessage(
`Failed to load css: ${event.target.href}`,
"warning"
);
}
},
true // useCapture - necessary for resource loading errors
);
}

</script>


{% endif %}


Expand Down Expand Up @@ -154,6 +133,7 @@ <h3 class="text-xl uppercase mt-12">Want to help?</h3>

{% block extra_js %}


{% endblock %}

</body>
Expand Down

0 comments on commit a67ce11

Please sign in to comment.