mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-28 17:37:52 +01:00
Improved error logging in event bus
This commit is contained in:
parent
ff63376550
commit
29e01878b2
@ -206,9 +206,15 @@ public class EventBusImpl implements EventBus {
|
||||
Object listener = eventListener.listener();
|
||||
eventListener.method().invoke(listener, event);
|
||||
} catch (IllegalAccessException e) {
|
||||
discordSRV.logger().error("Failed to access listener method: " + eventListener.methodName(), e);
|
||||
discordSRV.logger().error("Failed to access listener method: " + eventListener.methodName() + " in " + eventListener.className(), e);
|
||||
} catch (InvocationTargetException e) {
|
||||
discordSRV.logger().error("Failed to pass " + event.getClass().getSimpleName() + " to " + eventListener, e.getCause());
|
||||
String eventClassName = eventClass.getName();
|
||||
Throwable cause = e.getCause();
|
||||
if (eventListener.className().startsWith("com.discordsrv")) {
|
||||
discordSRV.logger().error("Failed to pass " + eventClassName + " to " + eventListener, cause);
|
||||
} else {
|
||||
e.getCause().printStackTrace();
|
||||
}
|
||||
}
|
||||
long timeTaken = System.currentTimeMillis() - startTime;
|
||||
logger.trace(eventListener + " took " + timeTaken + "ms to execute");
|
||||
|
Loading…
Reference in New Issue
Block a user