Closed Sallatik closed 5 years ago
Doesn't this provide what you ask for? https://github.com/pengrad/java-telegram-bot-api/blob/master/README.md#other-requests
You could use errorCode
and description
.
Thanks @futpib Yes, every response has methods:
boolean isOk()
int errorCode()
String description()
ResponseParameters parameters()
Now I see, sorry for bothering, I should be more careful reading docs
It seems like this library does not bother handling error response returned by telegram. For example,
bot.execute(new SendMessage(666, "Hello!")
will simply return an empty response. (Except if your bot has a chat with id=666, of course) Thus, all error messages are lost and it is nearly impossible to react to those errors in any way. Shall there be some kind of error handling mechanism added, probably using checked exceptions?