Skip to Content
PredictorSDK

SDKs 0.22.0 type the new error body and fix retries

The TypeScript, Python, and Go SDKs 0.22.0 read errors by code, stop waiting for the rate-limit window on server errors, never retry a 409, honour aborts and deadlines during a backoff, and work on Python 3.8 and 3.9.

SDKBreakingFix

The TypeScript (@predictorsdk/client), Python (predictorsdk), and Go (github.com/PredictorSDK/sdk-go) SDKs are released at 0.22.0, typing the new error shape shipped the same day. Upgrade now if you use Python: 0.21.0 and earlier require the removed error member, so every error response raises a ParsingError instead of its typed error.

  • Errors are read by code. ErrorResponse is code, message, statusCode (status_code in Python, StatusCode in Go), and the optional param and errors, a list of ErrorParamProblem (param, value, message). The 409 and 402 bodies carry code and message too. The error field is gone, so replace error.body.error with error.body.code, or error.body.message for display.
  • A server error no longer waits for the rate-limit window. The SDKs waited until X-RateLimit-Reset before retrying a 502 or 503, up to a minute per retry, because the API sends that header on every response. Only a 429 waits for it now. Other retried statuses honour Retry-After and otherwise back off from one second.
  • Python no longer retries a 409. An ambiguous identifier answers the same 409 every time, so a bare ID took over a minute and three requests to fail. Catch ConflictError and retry with a platform from e.body.candidates.
  • An abort or a deadline ends a wait. A TypeScript abortSignal and a Go context now cancel a backoff in progress, where the SDK used to finish the wait first. Go also returns after its last attempt instead of waiting once more.
  • Python 3.8 and 3.9 work with pydantic 2. Every call raised TypeError: unsupported operand type(s) for | on the versions the package declares, including the python3 macOS ships. CI now tests 3.9 as well as 3.12.
  • The docstrings match the API: market detail lists one outcome per option on a grouped market, pricing.source names every venue, and each status maps all nine venues.