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
Report-kinda | withReconnects() throws exception #51
Comments
Isn't that expected? It can't resolve because there's no internet connection? |
@theIglooo shouldn't it keep trying to reconnect instead of throwing exception, just for such case? At least isn't that what withReconnects() method for, preventing any manual reconnecting situation such as losing connection for a sec? |
There is no way the bot can even attempt to connect to discord if it can't lookup the IP address to connect to. Simple as that. If it was going to keep on reconnecting (assuming the IP address is cached), you will eventually get a |
@LolDatSec at least it should run the same code chunk to prevent such case, instead of terminating the process. |
@iGoodie That's not why you can't handle it, it's an unchecked exception. If that was case then you wouldn't be catching MissingPermissionsExceptions or any of those. I don't know what you want it to do, even if it hopelessly tries to reconnect it'll stop after the 3rd(?). |
When the lib encounters an error with the websocket, it is unrecoverable. You can try to login again later but a websocket error like this means that there is no use in trying to reconnect because the websocket wouldn't work correctly. And this is not something I can fix as all that code is internally Jetty Websocket's. And as previously mentioned, you have no internet connection so there's no use in reconnecting. |
Additionally, reconnects are mostly meant to reconnect to Discord after getting disconnected for some reason by Discord as Discord's cloudflare likes to randomly disconnect clients. |
Ummm but imagine that I lost my connection just for a second, then there is an use in trying to reconnect. Just like any application (like Discord) reconnects after you got your connection back. |
Yes, but it did try to reconnect. Additionally, you can still handle this yourself if the auto reconnect feature failed by listening for the DiscordDisconnectedEvent. |
Hash: 82c2bb4
After I made my bot login. I disabled my network adapter for test purposes and that happened on the console:
Tried to reconnect once, then threw exception.
The text was updated successfully, but these errors were encountered: