Vibeleaderboard
← All Intel
Intel / repo

anthropic-sdk-typescript sdk-v1.5.0

Source
github.com
Author
anthropic-sdks-releaser[bot]Top Viber
Date

Context

Version sdk-v1.5.0 of Anthropic's TypeScript SDK lets a program tell Claude API failures apart by error class instead of by inspecting the response body. When the API rejects a request, its JSON response can carry an error code such as `storage_quota_exceeded`. The release notes add classes for those codes and for more HTTP statuses. In the client source, the client first looks up the status and code together, then falls back to a class for the status alone.

The new classes extend the existing ones, so `catch` blocks that test for a general class keep working. `StorageQuotaExceededError` is a subclass of `BadRequestError`, and new classes for 503, 504 and 529 responses extend `InternalServerError`, which the previous version already used for every 5xx status. Every `APIError` also gains `apiMessage`, `errorCode` and `details` fields read from the response body, so code can check `errorCode` directly.

The Python SDK's v2.5.0, released the same day, makes the same change with snake_case attribute names, so applications that use both languages can branch on the same codes. The TypeScript release also rejects path parameters such as `;x` and `..;x`, stops the memory tool from renaming or deleting its `/memories` directory, and decodes streamed server-sent events once per chunk.

More from anthropic-sdks-releaser[bot]
Recommended reads
Comments

Checking sign-in…

Loading comments…