Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocketClient should propagate ConnectionClosedError after max_reconnects #818

Open
projects2080 opened this issue Dec 26, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@projects2080
Copy link

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

@projects2080 projects2080 added the enhancement New feature or request label Dec 26, 2024
@justinpolygon
Copy link
Contributor

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.

@projects2080
Copy link
Author

projects2080 commented Dec 29, 2024

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 projects2080 reopened this Dec 29, 2024
@justinpolygon
Copy link
Contributor

Great, thanks @projects2080.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants