Report render exceptions separately from data load failures#665
Merged
Conversation
The catch in loadRegistryData() was attached after the render step, so any exception thrown while rendering successfully fetched data was reported to the user as a network load failure, complete with a Retry button that could never help. This restores the confusion issue #660 set out to remove. Split the two failure modes: a rejected fetch still shows the existing load-error state, while an exception from onRegistryDataLoaded now shows a distinct "loaded, but could not be displayed" alert that includes the underlying error message and links to the issue tracker instead of offering a pointless Retry. Fixes #664 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #664.
Problem
loadRegistryData()wrapped both the fetch and the render in a single.catch(showLoadError), so any exception thrown while rendering successfully fetched data — including the deliberate "Registry data is missing its list of resources" guard — was presented to the user as a network load failure, with a Retry button that fails identically every time. This undercut the distinct error state introduced for #660/#661.Fix
loadRegistryData()now uses the two-argumentthen(onFulfilled, onRejected)form: a rejected fetch goes toshowLoadErroras before, whileonRegistryDataLoadedruns inside its own try/catch so render exceptions can no longer reach the load-error handler.showRenderError()shows a distinct alert: the data loaded, but an error occurred while displaying it, so retrying will not help. It includes the underlying error message and a "Report this problem" link to the issue tracker instead of a Retry button. Badges get the same—error treatment as a load failure.Verification
Exercised end-to-end in headless Chromium against the built site, using the reproduction from the issue:
categoryis a number): shows "Could not display the registry data" withDetails: r.category.toLowerCase is not a functionand the report link; badges read— resources/— KGs. Previously this showed the load-failure banner.resourceskey (valid JSON): shows the display error with "Registry data is missing its list of resources".🤖 Generated with Claude Code