Skip to content

Surface error cause chain in CLI error messages - #1190

Open
sholub-dev wants to merge 1 commit into
get-bb:mainfrom
sholub-dev:unwrap-error-cause-chain-in-cli
Open

Surface error cause chain in CLI error messages#1190
sholub-dev wants to merge 1 commit into
get-bb:mainfrom
sholub-dev:unwrap-error-cause-chain-in-cli

Conversation

@sholub-dev

Copy link
Copy Markdown

Summary

Fixes #1189. Node's fetch rejects with a constant TypeError: fetch failed and keeps the actionable error (e.g. connect EPERM 127.0.0.1:38886) on .cause, but the CLI's getErrorMessage only read .message, so every fetch failure printed the same uninformative Error: fetch failed.

Unwrap the cause chain when formatting errors, joining messages with : (a seen-set stops cyclic chains). A sandbox-blocked connection now prints Error: fetch failed: connect EPERM 127.0.0.1:38886 instead, which distinguishes a blocked connection from a server that is actually down. The existing ECONNREFUSED mapping to "Cannot connect to BB server" is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bb CLI: "Error: fetch failed" discards the error cause, making an unreachable backend indistinguishable from a dead one

1 participant