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: 408 and 504 do not map to KalshiTimeoutError #251
KalshiTimeoutError was introduced (#226) exactly to expose the "may have committed" semantic so callers can branch on it (e.g., query by client_order_id before retrying an order create). 408 Request Timeout from an intermediary or CDN, and 504 Gateway Timeout from upstream, carry that same semantic but route to generic KalshiError and KalshiServerError respectively. Callers writing except KalshiTimeoutError to handle the documented "reconcile via client_order_id" path silently miss the HTTP-status variant of the same condition.
Location
kalshi/_base_client.py:73-121 — _map_error status dispatch
Add if status in (408, 504): return KalshiTimeoutError(message=message, status_code=status) before the 5xx catch-all. Keep KalshiServerError for the rest of 5xx. Add regression tests.
Activity
fix(errors): map 408 and 504 to KalshiTimeoutError