Repository navigation
fix(cli): name the network cause of a failed fetch in the error box - #7236
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Approving at 081637f0.
Checked:
- Fails without the fix: I put
errors.tsback to the main version (b7a8cfa7) and the named test fails:names the network cause of a failed fetch on the third line, and nothing for a free-text causeis missing the expected"code: ETIMEDOUT"third line. With the fix, all 14 tests inerrors.test.tspass. - Message line unchanged: the second argument to
errorBoxis stillerr.message(fetch failed).recordFailure(title, hint ?? suggestion)records that same message, so anything matching on it sees no change. The cause shows up only in the suggestion slot, and only when the caller passed nosuggestion. - Scope: only the generic
Errorbranch changes.HyperframesApiErrorand non-Error values behave as before. The^[A-Z][A-Z0-9_]{2,40}$check keeps free-text or path-likecause.codevalues out of the output. - Types:
tscshows no errors incloud/errors.ts. CI passed on this head.
Nit (not blocking): networkCode and its one-line doc sit between reportApiError's long JSDoc block and the function itself. That JSDoc now attaches to networkCode, so reportApiError loses its hover docs. Moving networkCode above that block would fix it.
SanHsien
added a commit
to SanHsien/hyperframes
that referenced
this pull request
Nov 6, 2026
…eview Adopts or partially adopts 11 groups: multi-worker tween replay behind the timeline stand-in (heygen-com#7231), template entries in the shared compile stage (heygen-com#7217), HYPERFRAMES_CACHE_DIR and HYPERFRAMES_CONFIG_DIR for every per-user cache and settings file (heygen-com#7224, heygen-com#7229; HeyGen credentials stay under HEYGEN_CONFIG_DIR), WebKit audio clock (heygen-com#7225), packet-based video length (heygen-com#7233), HLG tone mapping (heygen-com#7234), fetch network cause (heygen-com#7236), .hyperframesignore in lint (heygen-com#7239), info --media (heygen-com#7235), lint priority (heygen-com#7244), check --budget (heygen-com#7245) and the unknown-command answer (heygen-com#7247). bun.lock gains only the lint `ignore` edge from heygen-com#7239, already resolved. Watermark advances to 0a6746e. Co-authored-by: Jerrai <[email protected]> Co-authored-by: Miguel Ángel <[email protected]> Co-authored-by: WaterrrForever <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
A cloud command whose network call fails prints only
fetch failed: the error'scause.code(ETIMEDOUT, ECONNRESET, ENOTFOUND, a TLS code) is dropped, so neither the person nor a host app can tell a timeout from a DNS failure or a bad certificate.Change
reportApiErroradds a third linecode: <CODE>to the box for a generic error whose cause carries an upper-case error code. The message line staysfetch failed, so anything matching that line keeps working. A cause code that is not shaped like an error code (free text, a path) is ignored; a caller's own suggestion still wins.Verified
errors.test.ts: 14 pass; the new test fails on main (the box gets no third line). Formatted with oxfmt; the repo lint hook was not run (no local install).fails without the fix: names the network cause of a failed fetch on the third line, and nothing for a free-text cause