mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
a11a4ac614
Upload source maps to Sentry GitOrigin-RevId: badbce7a5a72c3c2b5ad61d1ab2e458a52128e37
18 lines
652 B
JavaScript
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
|
|
})
|
|
}
|