Commit 6687b1a
committed
Detect disconnected websocket connections
With the current implementation, a disconnected websocket is not
detected as *all* exceptions are silently swallowed, resulting in
`rtm_read()` returning an empty list forever without raising any
kind of exception.
This makes it impossible to detect that the websocket has been
disconnected and keeps client libraries reading forever while never
receiving data anymore.
With these changes, a `TimeoutError` will be thrown when the socket
gets disconnected (and other exceptions should bubble up as well) so
that users of this library know they must re-connect.1 parent 39de600 commit 6687b1a
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
0 commit comments