Skip to content

Commit cc2bb4f

Browse files
committed
describe to get a more verbose stacktrace when consume exception happens.
1 parent c87daca commit cc2bb4f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,19 @@ same `channel_pat` will overwrite the old handler.
285285
Deregisters the event handler function that was previously registered via `on` or
286286
`register` method.
287287

288+
#### Debugging
289+
Websocket exceptions may occur during execution.
290+
It will usually happen during the `consume()` method, which basically is the
291+
websocket steady-state.<br>
292+
exceptions during the consume method may occur due to:
293+
- server disconnections
294+
- error while handling the response data
295+
296+
We handle the first issue by reconnecting the websocket every time there's a disconnection.
297+
The second issue, is usually a user's code issue. To help you find it, we added a flag to the
298+
StreamConn object called `debug`. It is set to False by default, but you can turn it on to get a more
299+
verbose logs when this exception happens.
300+
Turn it on like so `StreamConn(debug=True)`
288301

289302
---
290303
# Polygon API Service

0 commit comments

Comments
 (0)