feat: surface HTTP status and headers in CLI error output#313
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
When a request is intercepted by a forward proxy or egress filter returning a non-JSON 4xx (e.g. 403 with a custom X-Deny-Reason header), the SDK preserves statusCode and response headers but the CLI was dropping both, leaving users staring at a "looks like a transient Resend 5xx" message with no way to tell the request never reached Resend. Both JSON and TTY modes now expose the underlying status and a curated set of diagnostic headers (content-type, retry-after, x-*). Closes #312
5e8c101 to
a603cdd
Compare
Contributor
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Auto-approved: This change safely enhances error output by surfacing HTTP status, diagnostic headers, and optional body from the SDK, limited to CLI error display with filtered headers and comprehensive tests—no core logic, security, or infrastructure is affected.
Re-trigger cubic
The TTY branch of outputError gated the entire hint line on statusCode being a number, suppressing headers in the rare case a caller supplies them without a status. The JSON branch and the ErrorOutput type both treat the fields as independent; align TTY with that contract so any combination (status only, headers only, or both) is surfaced.
b940507 to
c190173
Compare
dielduarte
approved these changes
May 28, 2026
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.
When a request is intercepted by a forward proxy or egress filter returning a non-JSON 4xx (e.g. 403 with a custom X-Deny-Reason header), the SDK preserves statusCode and response headers but the CLI was dropping both, leaving users staring at a "looks like a transient Resend 5xx" message with no way to tell the request never reached Resend. Both JSON and TTY modes now expose the underlying status and a curated set of diagnostic headers (content-type, retry-after, x-*).
Closes #312
Summary by cubic
Expose HTTP status, diagnostic headers, and optional response body in CLI errors to help users tell upstream blocks from transient 5xx. Works in both JSON and TTY modes; satisfies DEV-921.
New Features
with-retryandspinnerpropagate statusCode and headers tooutputError.Dependencies
Written for commit 105849d. Summary will update on new commits.
Review in cubic