Repository navigation
fix: include the network cause in transport errors - #376
Merged
Merged
Conversation
Node's fetch reports every network failure as "fetch failed" and keeps the reason on error.cause, which transport() dropped. Users reporting a failed HypiHub catalogue check could not tell DNS, TLS, a reset or a timeout apart.
854771076
pushed a commit
to 854771076/hypit
that referenced
this pull request
Oct 9, 2026
Node's fetch reports every network failure as "fetch failed" and keeps the reason on error.cause, which transport() dropped. Users reporting a failed HypiHub catalogue check could not tell DNS, TLS, a reset or a timeout apart.
SanHsien
pushed a commit
to SanHsien/hypit
that referenced
this pull request
Oct 24, 2026
Node's fetch reports every network failure as "fetch failed" and keeps the reason on error.cause, which transport() dropped. Users reporting a failed HypiHub catalogue check could not tell DNS, TLS, a reset or a timeout apart. (cherry picked from commit adc0c5f)
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.
Problem
Node's
fetchreports every network-level failure asTypeError: fetch failedand keeps the actual reason onerror.cause.transport()copied onlyerror.message, so a user whose HypiHub catalogue check failed saw:That cannot distinguish DNS, TLS, a connection reset, a timeout or a proxy problem, and in this case it was misread as an upstream provider outage.
Change
transport()now appends the cause'scodeand message to theEndpointTransportErrormessage. Every provider's network failures pass through this function, so catalogue reads, OAuth refresh, uploads and downloads all gain the reason without changing any call site. The original message stays as the prefix, andcauseis still attached.Result
Measured by sending real failing requests through
transport():fetch failedfetch failed: getaddrinfo ENOTFOUND no-such-host.invalidfetch failedfetch failed: CERT_HAS_EXPIRED certificate has expiredfetch failedfetch failed: UND_ERR_CONNECT_TIMEOUT Connect Timeout Error (attempted address: 10.255.255.1:80, timeout: 10000ms)fetch failedfetch failed: bad portThe cause text comes from Node's network layer (host, address and port, error code, certificate reason). It does not contain URL paths, query strings or headers, so signed download URLs and tokens do not appear in it.
Verification
pnpm checkpasses.endpoint-kitorprovider-hypihub: 145 tests, 142 passed, 3 skipped, 0 failed. The fullpnpm testwas not run locally.