Added sending event errors to Discord
This commit is contained in:
parent
555faa7f52
commit
bd81c0f485
2 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue