Skip to content

Fall back to the standard status text when statusText is empty (1.2.1) - #10

Merged
freshlogic merged 1 commit into
mainfrom
status-text-fallback
Oct 27, 2026
Merged

freshlogic merged 1 commit into
mainfrom
status-text-fallback

Conversation

@freshlogic

Copy link
Copy Markdown
Member

On Node 26, walmart-marketplace's "should throw error for non 200 status code" tests fail: they expect 500 Internal Server Error but get 500 .

Root cause: Node 26's fetch (undici 8) negotiates HTTP/2 with servers that support it, and HTTP/2 has no reason phrase, so response.statusText is empty. HttpError builds its message from ${status} ${statusText}. Checked locally against httpbingo.org: Node 24.13.0 (undici 7.18.2) gives "Internal Server Error", Node 26.8.1 (undici 8.10.0) gives "".

Fix: when statusText is empty, use http.STATUS_CODES[status], so the same error has the same message (and APM grouping) over HTTP/1.1 and HTTP/2. A status code with no standard text keeps the old "599 " message. Adds tests, a 1.2.1 changelog entry, and a README note.

Every package that depends on ~1.2.0 without a lockfile (walmart-marketplace included) picks this up on its next npm install once 1.2.1 is published.

🤖 Generated with Claude Code

HTTP/2 responses have no reason phrase, and Node 26's fetch (undici 8)
negotiates HTTP/2 with servers that support it, so response.statusText is
'' and the message was "500 " instead of "500 Internal Server Error". Use
http.STATUS_CODES[status] when statusText is empty so the same error has
the same message (and APM grouping) over HTTP/1.1 and HTTP/2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40494088133

Coverage increased (+0.2%) to 96.552%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 4 of 4 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 69
Covered Lines: 67
Line Coverage: 97.1%
Relevant Branches: 18
Covered Branches: 17
Branch Coverage: 94.44%
Branches in Coverage %: Yes
Coverage Strength: 5.54 hits per line

💛 - Coveralls

@freshlogic
freshlogic merged commit 0ab23f7 into main Oct 27, 2026
1 of 2 checks passed
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.

2 participants