Repository navigation
feat(runtime): structure remote fetch errors - #28
Conversation
commit: |
f04e9ce to
2d9dbc0
Compare
|
Thanks for this. Typed fetch errors with a stable Must fix1. A stalled body on an HTTP error turns a known status into a timeout, or a hang. Previously
The test 2. Vite-path fetch failures get the wrong When
Suggested fix: pass an explicit Smaller follow-ups
Happy to help with any of these if useful. |
gioboa
left a comment
There was a problem hiding this comment.
Keep the known HTTP status when an error body stalls instead of reporting a timeout or hanging, and classify Vite remote fetch failures as HTTP, timeout, or network with correct retryability.
Summary
Problem
Remote fetch failures are currently exposed mostly as generic
Errorinstances. A person can infer the cause by reading the message, but consumers have no stable fields for distinguishing network, timeout, HTTP, response-size, and JSON parse failures. Automated decisions such as retries therefore have to be reimplemented by each caller.Before and after
ErrorRemoteFetchErrorcausecodestatus,statusText, andbodyPreviewretryabledirectlyThis PR keeps messages and the original
cause, while separating human-readable diagnostics from structured classification fields.Changes
RemoteFetchErrorandTANSTACK-REMOTE-FETCH-*error codesstatus,statusText, a maximum 240-characterbodyPreview, andretryableValidation
pnpm --filter @module-federation/tanstack typecheck: passednode --test test/remote-fetch.test.mjs: 7/7 passedpnpm --filter @module-federation/tanstack build: passednode --test test/release-contracts.test.mjs: 32/32 passednode --test test/release-artifacts.test.mjs: 2/2 passed