Skip to content
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

Merged
merged 2 commits into from
Oct 14, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Oct 11, 2024

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

@mydea mydea self-assigned this Oct 11, 2024
@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Oct 11, 2024
Copy link
Contributor

🚨 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 #discuss-dev-infra channel.

@mydea mydea merged commit 333e1ae into master Oct 14, 2024
51 checks passed
@mydea mydea deleted the fn/try-catch-loader branch October 14, 2024 06:38
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Out of Memory (OOM) since updating CDN to Loader v8
2 participants