-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(loader): Catch errors in sentryOnLoad
separately
#78993
Conversation
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
…3952) Updates the loader & adds tests for getsentry/sentry#78993
…3952) Updates the loader & adds tests for getsentry/sentry#78993
If a user has an error in their `sentryOnLoad` function for the Loader Script, we do try-catch it today, but we stop any further processing, leading to possible issues down the line (e.g. errors not being sent to Sentry etc). This PR changes this so that we catch errors in this first, and continue if it happens. This means that we'll still do the default `Sentry.init()` and send the error that triggered lazy loading to Sentry - this was previously swallowed by the catch. Closes getsentry/sentry-javascript#13939 Test added here: getsentry/sentry-javascript#13952
If a user has an error in their
sentryOnLoad
function for the Loader Script, we do try-catch it today, but we stop any further processing, leading to possible issues down the line (e.g. errors not being sent to Sentry etc).This PR changes this so that we catch errors in this first, and continue if it happens. This means that we'll still do the default
Sentry.init()
and send the error that triggered lazy loading to Sentry - this was previously swallowed by the catch.Closes getsentry/sentry-javascript#13939
Test added here: getsentry/sentry-javascript#13952