Skip to content

Conversation

iskounen
Copy link
Contributor

@iskounen iskounen commented Aug 6, 2025

This PR adds global error handlers to find the source of "Load failed" errors across the application. Specifically, it:

  1. Captures resource loading failures (scripts, images, CSS files) with detailed context
  2. Monitors unhandled promise rejections for network-related errors

It adds the following tags in Sentry to identify these errors:

  • "resource_load_failure" - Failed resource loading
  • "network_failure" - Unhandled network promise rejections

cc: @artsy/diamond-devs

…ging

- Add global error handlers for resource loading failures (scripts, images, CSS)
- Track unhandled promise rejections for network errors
- Capture detailed error context including resource URLs, types, and element HTML
- Integrate error tracking into client initialization
- Document future enhancement opportunities for fetch tracking, CSP violations, etc.

This addresses the #1 Sentry issue by providing visibility into all types of
resource loading failures across the application.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@iskounen iskounen requested review from dzucconi and rabidpaul August 6, 2025 16:11
@iskounen iskounen self-assigned this Aug 6, 2025
@iskounen
Copy link
Contributor Author

iskounen commented Aug 6, 2025

I'm queueing this up to launch this afternoon. I haven't seen any changes in the issues logged to Sentry after deploying #15957 and #15958 this morning, so I will wait a bit longer, then revert those and deploy this to see if we can find any clues at a higher level.

Copy link
Contributor

@rabidpaul rabidpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you have some todos here for additional considerations. It would be good to pair these PRs with the monitors/dashboards you're using to monitor, and hopefully with documentation (hopefully next to the data) to explain how you're using them to illustrate health of the system, especially to outsiders.

@iskounen
Copy link
Contributor Author

iskounen commented Aug 6, 2025

Once I see some indication that these error handlers are catching useful issues I'll create a dashboard to organize and monitor them.

I'm hopeful that this iteration of error handling will show us something interesting because I'm seeing that the "Type Error: Load failed" issues in Sentry have a onunhandledrejection in the tags section.

@iskounen iskounen merged commit 3baebd4 into main Aug 6, 2025
10 checks passed
@iskounen iskounen deleted the iskounen/chore/type-error-global-error-handlers branch August 6, 2025 19:14
@artsy-peril artsy-peril bot mentioned this pull request Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants