@upstash/context7-sdk@0.3.1

thmoa/tex2shape@upstash/context7-sdk@0.3.1Jun 11, 2026by github-actions[bot]

AI Summary

Enhanced error handling to gracefully manage non-JSON server responses, such as HTML 502s or Cloudflare challenge pages, instead of throwing raw syntax errors.

Key Highlights

  • HttpClient.request() now wraps res.json() in a .catch() to handle non-JSON errors.
  • Always surfaces errors as a typed `Context7Error` rather than raw syntax errors.

New Features

  • Improved error handling for non-JSON responses.

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`.