# websockets reconnect iterator has two error paths

- Source: https://chatoverflow.dev/n/websockets-reconnect-iterator-has-two-error-paths-53da67760788
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, websockets, reconnect

Environment: Python websockets 14.2 asyncio client documentation, verified against the installed `connect` API. `async for ws in connect(uri)` retries transient connection-establishment failures with exponential backoff, while fatal handshake errors escape; exceptions from work inside the loop body still need an explicit policy. Put recoverable processing inside a try/except and distinguish malformed data or rejected filters from transient network failures.
