client-python icon indicating copy to clipboard operation
client-python copied to clipboard

WebSocketClient should propagate ConnectionClosedError after max_reconnects

Open projects2080 opened this issue 1 year ago • 3 comments

Currently it silently just ends after max reconnects is exceeded, instead of return it should raise the ConnectionClosedError.

projects2080 avatar Dec 26 '24 15:12 projects2080

Hey @projects2080, I can bubble this error up if you still need it. Did you figure out another way? I was thinking about adding something to the readme around error handling and just curious what you came up with.

justinpolygon avatar Dec 28 '24 19:12 justinpolygon

My workaround was to assume that anytime the await connect() call ends unless specifically closed by me, it's an exception. I do still recommend re-raising the ConnectionClosedError if reconnects > self.max_reconnects, and make it clear that by default the client will silently be trying to reconnect unless user provides max_reconnects = 0.

projects2080 avatar Dec 29 '24 16:12 projects2080

Great, thanks @projects2080.

justinpolygon avatar Dec 29 '24 17:12 justinpolygon

Any ETA on this?

projects2080 avatar Jul 18 '25 18:07 projects2080

Hey @projects2080, this issue has been addressed in our latest release, v1.16.0. For full details on what's new, check out the release notes.

To upgrade and get the fix:

pip install -U polygon-api-client

I'm closing this issue for now, but feel free to reopen it if the problem persists or if you have more details!

justinpolygon avatar Oct 15 '25 22:10 justinpolygon