Skip to content

Conversation

@morgan-wowk
Copy link

@morgan-wowk morgan-wowk commented Jan 26, 2026

Description

Created a unified ErrorHandler component to standardize error handling across the application. This component automatically reports errors to Bugsnag and provides consistent error display functionality for both React Error Boundaries and Router errors.

The new component:

  • Handles error reporting to Bugsnag with appropriate metadata
  • Provides consistent refresh and "go home" functionality
  • Separates error handling logic from display concerns

Updated FullPageError to use the new ErrorHandler component instead of directly using ErrorDisplay.

Type of Change

  • Improvement
  • Cleanup/Refactor

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  1. Trigger application errors to verify they are properly handled and reported
  2. Verify that the "Refresh" and "Go Home" buttons work correctly
  3. Check Bugsnag to ensure errors are being reported with the correct metadata

Copy link
Author

morgan-wowk commented Jan 26, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@morgan-wowk morgan-wowk force-pushed the 01-26-refactor-error-component-names branch from 5002cbc to dc253c8 Compare January 26, 2026 21:02
@morgan-wowk morgan-wowk force-pushed the 01-26-feat_add_unified_errorhandler_component_add_errorhandler_to_unify_error_handling_logic_for_both_react_error_boundaries_and_router_errors._automatically_reports_errors_to_bugsnag_and_provides_consistent_error_display_with_retry_g branch from 0fa7ae0 to b8f873e Compare January 26, 2026 21:02
@morgan-wowk morgan-wowk force-pushed the 01-26-refactor-error-component-names branch from dc253c8 to 9be3ab2 Compare January 26, 2026 21:07
@morgan-wowk morgan-wowk force-pushed the 01-26-feat_add_unified_errorhandler_component_add_errorhandler_to_unify_error_handling_logic_for_both_react_error_boundaries_and_router_errors._automatically_reports_errors_to_bugsnag_and_provides_consistent_error_display_with_retry_g branch from b8f873e to 2f5f3a3 Compare January 26, 2026 21:07
@morgan-wowk morgan-wowk force-pushed the 01-26-refactor-error-component-names branch from 9be3ab2 to d2ad4cd Compare January 26, 2026 21:10
@morgan-wowk morgan-wowk force-pushed the 01-26-feat_add_unified_errorhandler_component_add_errorhandler_to_unify_error_handling_logic_for_both_react_error_boundaries_and_router_errors._automatically_reports_errors_to_bugsnag_and_provides_consistent_error_display_with_retry_g branch from 2f5f3a3 to bedeb6d Compare January 26, 2026 21:10
@morgan-wowk morgan-wowk marked this pull request as ready for review January 26, 2026 21:13
@morgan-wowk morgan-wowk requested a review from a team as a code owner January 26, 2026 21:13

const handleRefresh = () => {
// Reset error boundary if available before reloading
resetErrorBoundary?.();
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this used for? seems like its only used in this file. lets remove it if we don't need it.

Comment on lines +48 to +52
if (onGoHome) {
onGoHome();
} else {
window.location.href = "/";
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we can just default onGoHome to be

onGoHome = () => window.location.href = "/";

NIT: Do we rename this to something else? onGoToSafeURL or something


if (config.enabled && error instanceof Error) {
Bugsnag.notify(error, (event) => {
event.addMetadata("error_handler", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we remove this magic string?

@morgan-wowk morgan-wowk force-pushed the 01-26-feat_add_unified_errorhandler_component_add_errorhandler_to_unify_error_handling_logic_for_both_react_error_boundaries_and_router_errors._automatically_reports_errors_to_bugsnag_and_provides_consistent_error_display_with_retry_g branch from bedeb6d to 2b4b0cd Compare January 28, 2026 18:33
@morgan-wowk morgan-wowk force-pushed the 01-26-refactor-error-component-names branch from d2ad4cd to bedad4c Compare January 28, 2026 18:33
@morgan-wowk morgan-wowk force-pushed the 01-26-feat_add_unified_errorhandler_component_add_errorhandler_to_unify_error_handling_logic_for_both_react_error_boundaries_and_router_errors._automatically_reports_errors_to_bugsnag_and_provides_consistent_error_display_with_retry_g branch from 2b4b0cd to 7e226d9 Compare January 28, 2026 18:48
@morgan-wowk morgan-wowk force-pushed the 01-26-refactor-error-component-names branch from bedad4c to 43e186c Compare January 28, 2026 18:48
Add ErrorHandler to unify error handling logic for both React Error
Boundaries and Router errors. Automatically reports errors to Bugsnag
and provides consistent error display with retry/go-home actions.
@morgan-wowk morgan-wowk force-pushed the 01-26-refactor-error-component-names branch from 43e186c to a8636d6 Compare January 28, 2026 19:21
@morgan-wowk morgan-wowk force-pushed the 01-26-feat_add_unified_errorhandler_component_add_errorhandler_to_unify_error_handling_logic_for_both_react_error_boundaries_and_router_errors._automatically_reports_errors_to_bugsnag_and_provides_consistent_error_display_with_retry_g branch from 7e226d9 to 9322f42 Compare January 28, 2026 19:21
Copy link
Author

Note: I am actively working on implementing a refactor to simplify the contents of this PR

@morgan-wowk morgan-wowk changed the base branch from 01-26-refactor-error-component-names to graphite-base/1697 January 28, 2026 19:54
Copy link
Author

This branch is not needed and closed.

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.

3 participants