Replies: 5 comments
-
more code please |
Beta Was this translation helpful? Give feedback.
-
@bvn13 sorry, what code do you need? Here is signature of AbsSender#executeAsync: https://github.com/rubenlagus/TelegramBots/blob/master/telegrambots-meta/src/main/java/org/telegram/telegrambots/bots/AbsSender.java#L39 public <T extends Serializable, Method extends BotApiMethod<T>, Callback extends SentCallback<T>> void executeAsync(Method method, Callback callback) throws TelegramApiException Second parameter - So i'm wondering why not send exception thrown via that |
Beta Was this translation helpful? Give feedback.
-
It throws it because it has to validate that both parameters are not-null. If any of them is null, an exception is thrown right away. |
Beta Was this translation helpful? Give feedback.
-
@rubenlagus but why this is not done in callback's onException method? |
Beta Was this translation helpful? Give feedback.
-
@n0mer Because this exception is throw if you provide a null callback, in such a case, it is imposible to call onException method. In addition, the callback is intended for error occurring during method execution, not for errors occurred before it is actually executed |
Beta Was this translation helpful? Give feedback.
-
hello,
org.telegram.telegrambots.bots.AbsSender#executeAsync
throwsorg.telegram.telegrambots.exceptions.TelegramApiException
although there is callback functionorg.telegram.telegrambots.updateshandlers.SentCallback#onException
present.Beta Was this translation helpful? Give feedback.
All reactions