diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/ListenerManagerPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/ListenerManagerPlugin.java index 7d920d48..7072f152 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/ListenerManagerPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/ListenerManagerPlugin.java @@ -24,14 +24,14 @@ public class ListenerManagerPlugin { for (final Listener listener : listeners) { try { consumer.accept(listener); - } catch (final Exception e) { + } catch (final Throwable throwable) { bot.logger.error( Component.translatable( - "Caught exception while trying to dispatch an event to %s!", + "Caught an error while trying to dispatch an event to %s!", Component.text(listener.getClass().getSimpleName()) ) ); - bot.logger.error(e); + bot.logger.error(throwable); } } } @@ -44,14 +44,14 @@ public class ListenerManagerPlugin { final Boolean result = function.apply(listener); if (result != null && !result) break; - } catch (final Exception e) { + } catch (final Throwable throwable) { bot.logger.error( Component.translatable( - "Caught exception while trying to dispatch an event with a returning boolean to %s!", + "Caught an error while trying to dispatch an event with a returning boolean to %s!", Component.text(listener.getClass().getSimpleName()) ) ); - bot.logger.error(e); + bot.logger.error(throwable); } } } diff --git a/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java b/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java index abf19a10..f76c8689 100644 --- a/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java +++ b/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java @@ -249,7 +249,7 @@ public class ComponentUtilities { result.add(Component.text(remaining)); } - } catch (final Exception e) { + } catch (final Throwable throwable) { result.clear(); result.add(Component.text(format)); }