diff --git a/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java b/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java index 314a2a6b..faff4c29 100644 --- a/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java +++ b/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java @@ -109,8 +109,14 @@ public class DiscordHandler extends ListenerAdapter { } } final String contentF = content; - new RunnerClient(contentF, mentionedBot, channelName, datahandler, stanfordCoreNLP, stanfordCoreNLPSentiment, - event, username); + try { + new RunnerClient(contentF, mentionedBot, channelName, datahandler, stanfordCoreNLP, stanfordCoreNLPSentiment, + event, username); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + //the JDA library wants to keep the program alive even when an error is happening. hopefully this just makes the program crash when an error happens. + } } } }