Skip to content

Wrap body-read failures in GradientLabsError; fix README webhook example - #21

Open
nlathia wants to merge 1 commit into
mainfrom
neal/readme-unknown-webhook-and-body-read-errors
Open

nlathia wants to merge 1 commit into
mainfrom
neal/readme-unknown-webhook-and-body-read-errors

Conversation

@nlathia

@nlathia nlathia commented Nov 13, 2026

Copy link
Copy Markdown
Member

Changes

  • HttpClient.request(): response.text() failures (e.g. connection reset or timeout abort mid-body) are now thrown as GradientLabsError with cause preserved, matching fetch and JSON-parse failures. Previously they escaped as raw errors despite the base-class docs.
  • README webhook example: import UnknownWebhookTypeError and respond 200 for it (as examples/webhooks already does), instead of 500, which would likely cause retries for new event types.
  • Test for the body-read case; CHANGELOG entry.

Tests, lint and tsc pass.

🤖 Generated with Claude Code

…hook type in README

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nlathia
nlathia requested review from a team as code owners November 13, 2026 22:53
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.

1 participant