Skip to content

Show the shared error page for uncaught render errors - #1326

Merged
microbit-matt-hillsdon merged 1 commit into
mainfrom
error-page
Sep 11, 2026
Merged

Show the shared error page for uncaught render errors#1326
microbit-matt-hillsdon merged 1 commit into
mainfrom
error-page

Conversation

@microbit-matt-hillsdon

@microbit-matt-hillsdon microbit-matt-hillsdon commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Takes @microbit/ui-patterns 0.6.1 and uses its ErrorBoundary and
UnexpectedErrorPage at the root route. The react-router change had put
the app's own ErrorBoundary there, whose inline "download your hex
file" text assumes the editor is still on screen; full-page it is not.
That boundary is unchanged around the sidebar panels, where a
documentation tab failing to load (typically a blocked Sanity domain)
still shows the inline message beside a working editor.

The page shows an error reference so a support request can be matched
to the Sentry report. Logging.error now returns that reference (the
event id from captureException) when the error was sent, and the root
layout passes it through to the page. The support link is the brand's;
deployments without one get no support sentence, as with the help menu.

@github-actions

Copy link
Copy Markdown

Preview build will be at
https://review-python-editor-v3.microbit.org/error-page/

Takes @microbit/ui-patterns 0.6.1 and uses its ErrorBoundary and
UnexpectedErrorPage at the root route. The react-router change had put
the app's own ErrorBoundary there, whose inline "download your hex
file" text assumes the editor is still on screen; full-page it is not.
That boundary is unchanged around the sidebar panels, where a
documentation tab failing to load (typically a blocked Sanity domain)
still shows the inline message beside a working editor.

The page shows an error reference so a support request can be matched
to the Sentry report. Logging.error now returns that reference (the
event id from captureException) when the error was sent, and the root
layout passes it through to the page. The support link is the brand's;
deployments without one get no support sentence, as with the help menu.
@microbit-matt-hillsdon

microbit-matt-hillsdon commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

Evil hack to test:

(() => {
  const orig = Element.prototype.querySelector;
  Element.prototype.querySelector = function (sel) {
    if (String(sel).includes("data-panel-content")) {
      throw new Error("review: forced render error");
    }
    return orig.call(this, sel);
  };
})();

Then change tab. Will merge and re-run on beta which should have the actual Sentry reference.

@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit 1e8a494 into main Sep 11, 2026
1 check passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the error-page branch September 11, 2026 21:12
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.

1 participant