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--) {
|
for (int i = msgs.size() - 1; i >= 10; i--) {
|
||||||
genchannel.unpin(msgs.get(i));
|
genchannel.unpin(msgs.get(i));
|
||||||
}
|
}
|
||||||
|
TBMCCoreAPI.SendUnsentExceptions();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,10 @@ public class ExceptionListener implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onException(TBMCExceptionEvent e) {
|
public void onException(TBMCExceptionEvent e) {
|
||||||
SendException(e.getException(), e.getSourceMessage());
|
SendException(e.getException(), e.getSourceMessage());
|
||||||
|
e.setHandled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SendException(Throwable e, String sourcemessage) {
|
private static void SendException(Throwable e, String sourcemessage) {
|
||||||
try {
|
try {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(sourcemessage).append("\n");
|
sb.append(sourcemessage).append("\n");
|
||||||
|
|
Loading…
Reference in a new issue