mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
This moves raven init into a dedicated file where it's configured on load, we no longer load it on /help, but there's only css there so there wasn't anything that could fail anyway. We will also now fail in the most visible way if the value passed to raven is invalid (as in invalid syntax)
18 lines
451 B
JavaScript
18 lines
451 B
JavaScript
var Sentry = (function() {
|
|
|
|
// init sentry client if sentry dsn is set
|
|
if ($("body").data("raven-dsn")) {
|
|
var dsn = $("body").data("raven-dsn").replace("\/", "/");
|
|
// raven itself can fail if invalid DSN is passed
|
|
try {
|
|
Raven.config(dsn, {
|
|
release: $("body").data("unsee-version")
|
|
}).install();
|
|
} catch (error) {
|
|
var msg = "Sentry error: " + error.message;
|
|
$("#raven-error").text(msg).removeClass("hidden");
|
|
}
|
|
}
|
|
|
|
})();
|