Made the exception handler more reliable
This commit is contained in:
parent
b43b7c86ff
commit
e7531fd830
2 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue