refactor(frontend): better gateway errors#5029
Conversation
Code Review: refactor(frontend): better gateway errorsOverviewThis PR significantly improves how the inspector surfaces gateway/engine errors to users. Key changes:
Overall the change is a clear improvement in both UX and code clarity. A few things worth noting below. IssuesEngineErrorBlock may double-render the message EngineErrorBlock renders body.message in a paragraph tag and then passes the full body object to ErrorDetails. If ErrorDetails also renders the message field inline, the message appears twice. If ErrorDetails is a collapsible raw-dump panel this is intentional and fine, but worth verifying. package.json indentation changed from tabs to spaces The file was reformatted from hard tabs to 2-space indentation as a side-effect of this PR. Mixing a whitespace-only reformat into a functional PR makes the diff harder to review. It also introduced a missing newline at end of file at line 346. mockServiceWorker.js is served in production builds The file lives in public/ and is therefore included in production bundles. It is inert since agent-mocks.ts only registers the worker when import.meta.env.DEV and ?mock=1 is in the URL, so there is no functional concern. This is the standard MSW recommendation; just worth noting for future contributors. Version check now takes precedence over all errors, including 401/403 The old code checked the version only inside the statusCode === 404 branch. The new code checks version first regardless of status code, so a 401/403/503 response shows "RivetKit is outdated" instead of the auth/gateway error if the version is below minimum. The comment explains this is intentional and it is probably the right call. Worth confirming whether this could hide a legitimate auth misconfiguration in self-hosted environments where operators might run mixed versions. Minor Suggestions
Positives
|
2e537d4 to
b166ca6
Compare
a460166 to
8656480
Compare
b166ca6 to
f3897b9
Compare
8656480 to
97eef41
Compare
97eef41 to
f117d1b
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: