-
Notifications
You must be signed in to change notification settings - Fork 101
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
No reconnect on connecton issues #305
Comments
Could you share the code that you are using ? It would help me give you some pointers on how to deal with this exception, there is indeed nothing in the doc about that but that could be handled pretty much the same way any exception would (we won't retry inside the library as it is decision that need to be made by the user and needs might be pretty different for all of us) |
Essentially it's this:
And then in
|
Yeah, that's true, but it might be quite common use, so maybe it can be set as an input parameter when constructing the instance? Like, no reconnects by default, but the caller can also indicate the reconnects are needed (probably a specific interval or some backoff) |
@ex0ns, do you by any chance have any thoughts regarding the above? |
Hello Sorry I don't have a proper solution as of now (one that I'm liking anyway), and I'm pretty busy, I would definitely encourage you to propose an implementation if you feel like it, otherwise it might have to wait on my side and I might tackle it when I have more room for it |
I tried to start my bot when the Internet connection was absent and it (obviously) failed with
java.net.UnknownHostException: api.telegram.org
exception (the full stack trace is below).The issue is that it hasn't tried to reconnect after that and there seem to be no examples or docs about how to handle connection exceptions and may be kick off a reconnect from the code.
Is it possible to detect it in the current version of the code? If not, can either automatic reconnects, or error callbacks, or examples (if it's already there) be added?
The text was updated successfully, but these errors were encountered: