Made the exception handler more reliable

This commit is contained in:
Norbi Peti 2016-11-03 22:45:21 +01:00
parent b43b7c86ff
commit e7531fd830
2 changed files with 3 additions and 1 deletions

View file

@ -106,6 +106,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
for (int i = msgs.size() - 1; i >= 10; i--) {
genchannel.unpin(msgs.get(i));
}
TBMCCoreAPI.SendUnsentExceptions();
} catch (Exception e) {
e.printStackTrace();
}

View file

@ -10,9 +10,10 @@ public class ExceptionListener implements Listener {
@EventHandler
public void onException(TBMCExceptionEvent e) {
SendException(e.getException(), e.getSourceMessage());
e.setHandled();
}
public static void SendException(Throwable e, String sourcemessage) {
private static void SendException(Throwable e, String sourcemessage) {
try {
StringBuilder sb = new StringBuilder();
sb.append(sourcemessage).append("\n");