overleaf/services/web/frontend/js/utils/sentry.js
Alasdair Smith db610f7efb Merge pull request #2657 from overleaf/revert-2650-revert-2570-as-sentry-source-maps
Bring back upload source maps to Sentry

GitOrigin-RevId: 22024e3ec2462d0bc9ad9c14e8d1c21880c55cd1
2020-04-01 03:21:16 +00:00

18 lines
652 B
JavaScript

// Conditionally enable Sentry based on whether the DSN token is set
if (window.ExposedSettings.sentryDsn) {
import(/* webpackChunkName: "sentry" */ '@sentry/browser').then(Sentry => {
Sentry.init({
dsn: window.ExposedSettings.sentryDsn,
// Ignore errors unless they come from overleaf.com/sharelatex.com
// Adapted from: https://docs.sentry.io/platforms/javascript/#decluttering-sentry
whitelistUrls: [
/https:\/\/[a-z]+\.overleaf\.com/,
/https:\/\/[a-z]+\.sharelatex\.com/
]
})
// Previously Raven added itself as a global, so we mimic that old behaviour
window.Raven = Sentry
})
}