diff --git a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java index 317f222f..7a3ebca5 100644 --- a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java +++ b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java @@ -599,7 +599,7 @@ public abstract class BaseAbilityBot extends DefaultAbsSender implements Ability boolean runSilently(Callable callable, String name) { try { return callable.call(); - } catch(Exception ex) { + } catch(Throwable ex) { log.error(format("Reply [%s] failed to check for conditions. " + "Make sure you're safeguarding against all possible updates.", name)); } diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java b/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java index da98f1b8..95e247f3 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java +++ b/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java @@ -214,7 +214,7 @@ public class DefaultBotSession implements BotSession { } log.debug(e.getLocalizedMessage(), e); interrupt(); - } catch (Exception global) { + } catch (Throwable global) { log.error(global.getLocalizedMessage(), global); try { synchronized (lock) { @@ -322,7 +322,7 @@ public class DefaultBotSession implements BotSession { } catch (InterruptedException e) { log.debug(e.getLocalizedMessage(), e); interrupt(); - } catch (Exception e) { + } catch (Throwable e) { log.error(e.getLocalizedMessage(), e); } }