From 9b371ce1ca0668d5667199f5b5005740063ec508 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 5 Jun 2023 02:08:33 +0200 Subject: [PATCH] just stop being retarded and crash as you should when an error occurs --- .../main/java/PresentationLayer/DiscordHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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. + } } } }