Skip to content

Preserve error response body when error field is absent#1900

Open
FU-max-boop wants to merge 1 commit into
openai:masterfrom
FU-max-boop:fix/error-body-fallback-message
Open

Preserve error response body when error field is absent#1900
FU-max-boop wants to merge 1 commit into
openai:masterfrom
FU-max-boop:fix/error-body-fallback-message

Conversation

@FU-max-boop
Copy link
Copy Markdown

Summary

  • fall back to the full JSON error response when a response body does not contain an error field
  • preserve the existing behavior of preferring the nested error object when present
  • add regression coverage for compatible APIs that return bodies like { detail: ... }

Fixes #1734

Tests

Note: yarn install --frozen-lockfile was blocked locally by a timeout downloading the repository's tsc-multi GitHub release tarball, so I ran the focused Jest test through npx with the same SWC transform/module mapping instead.

@FU-max-boop FU-max-boop requested a review from a team as a code owner May 28, 2026 20:04
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.

The node.js client only reads errors from the "error" field of a response, with no fallback if it doesn't exist

1 participant