Added sending event errors to Discord

This commit is contained in:
Norbi Peti 2016-10-23 02:51:35 +02:00
parent 555faa7f52
commit bd81c0f485
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,11 @@
package buttondevteam.discordplugin;
import org.bukkit.event.Event;
public class EventExceptionDiscordSender implements EventExceptionHandler {
@Override
public boolean handle(Throwable ex, Event event) {
TBMCDiscordAPI.SendException(ex, "An error occured while executing " + event.getEventName() + "!");
return true;
}
}

View file

@ -7,7 +7,7 @@ import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.lang.exception.ExceptionUtils;
public final class TBMCDiscordAPI {
public static void SendException(Exception e, String sourcemessage) {
public static void SendException(Throwable e, String sourcemessage) {
try {
//System.out.println("A");
// ByteArrayOutputStream baos = new ByteArrayOutputStream();