You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Errors: content-length cap on error body drops the typed-exception class #252
A 429 (or 401, 409, 422, 504) whose body advertises >16KB returns a generic KalshiError from _map_error. Two concrete consequences:
The retry loop's isinstance(error, KalshiRateLimitError) Retry-After branch is bypassed, so a hostile-but-otherwise-valid 429 with a verbose body falls back to computed backoff and ignores the server's Retry-After hint.
Caller code structured as except KalshiRateLimitError / except KalshiAuthError / except KalshiConflictError silently misses these responses.
The size cap (#203) is correct in principle; only the exception class is wrong.
After the size-check short-circuit, still dispatch on status to the type-specific exception with the suppressed-body message. Easiest: build message = f"HTTP {status} (body {content_length} bytes, suppressed)", set body = {}, then fall through to the existing status dispatch.
Activity
fix(errors): preserve typed exception class when body is suppressed
feat(transport): preserve typed errors on body cap; map 408/504; perf…