-
Notifications
You must be signed in to change notification settings - Fork 49
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
[asyncio] Catch ConnectionErrors and force reconnect. #54
Comments
It seems that (at least on Mac) "No route to host" is raised as an OSError. TimeoutError extend OSError, so that shouldn't make too much of a difference. Anyway, a No route to host error is also not being caught by pydle, meaning no reconnect. |
Thanks for reporting. This seems easy enough to fix, I'll take a look at it. |
I should probably note that if a TimeoutError occurs while in the main handle_forever() loop, that catching things in the connect() function will not help much. |
It might be a good idea when building this to include some kind of callback in case of an error which also passed the exception/error object, for example, I am building a multi-network bot, and i want to be able to send a pm to the owner with specifics on the error, or a log channel, etc. |
Can this be fixed? Currently it's pretty useless, as disconnects aren't reliably handled and sometimes it just exits the loop rather than trying to reconnect. |
it can: replace line 368 in
and 375:
|
If a connection has a ConnectionError (for example ConnectionResetError), it does not get detected by pydle, and does not reconnect. It also seems that TimeoutErrors are not being caught either, once again causing pydle to not reconnect.
The text was updated successfully, but these errors were encountered: