Catch-all clauses should catch Throwable instead of Exception class.
Base class for all exception is Throwable, and it's possible to skip some of them by catching only Exception. e.g., throwing AssertionError will lead to thread termination
This commit is contained in:
parent
e6b9fd892f
commit
10ad9b1a95
@ -599,7 +599,7 @@ public abstract class BaseAbilityBot extends DefaultAbsSender implements Ability
|
||||
boolean runSilently(Callable<Boolean> 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));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user