@upstash/context7-sdk@0.3.1

ruixenui/ruixen.com@upstash/context7-sdk@0.3.1Jun 11, 2026by github-actions[bot]

AI Summary

Improves error handling by wrapping non-JSON server responses in a typed Context7Error, preventing raw SyntaxError throws for HTML or text responses.

Key Highlights

  • Improved error handling for non-JSON responses
  • Consistent typed Context7Error surface
  • Handles HTML 502s and plain text 429s gracefully

New Features

  • Better error handling
  • Type safety for network errors

Full Release Notes

### Patch Changes

- f327589: Avoid throwing a raw `SyntaxError` when the server returns a non-JSON error body. `HttpClient.request()` now wraps the error-path `res.json()` in a `.catch`, so non-JSON responses (HTML 502s, plain-text 429s, Cloudflare challenge pages) fall back to `res.statusText` and always surface as a typed `Context7Error`.