Skip to content

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 requested review from AbhiPrasad and Lms24 October 11, 2024 09:29
@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
@github-actions
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
49 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
billyvg pushed a commit to getsentry/sentry-javascript that referenced this pull request Oct 17, 2024
cmanallen pushed a commit that referenced this pull request Oct 23, 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
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

3 participants