Fix logger usage in EventBusImpl

This commit is contained in:
Vankka 2023-07-12 21:27:29 +03:00
parent 2146fe29aa
commit 9bb2502cdb
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0

View File

@ -208,12 +208,12 @@ public class EventBusImpl implements EventBus {
Object listener = eventListener.listener(); Object listener = eventListener.listener();
eventListener.method().invoke(listener, event); eventListener.method().invoke(listener, event);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
discordSRV.logger().error("Failed to access listener method: " + eventListener.methodName() + " in " + eventListener.className(), e); logger.error("Failed to access listener method: " + eventListener.methodName() + " in " + eventListener.className(), e);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
String eventClassName = eventClass.getName(); String eventClassName = eventClass.getName();
Throwable cause = e.getCause(); Throwable cause = e.getCause();
if (eventListener.className().startsWith("com.discordsrv")) { if (eventListener.className().startsWith("com.discordsrv")) {
discordSRV.logger().error("Failed to pass " + eventClassName + " to " + eventListener, cause); logger.error("Failed to pass " + eventClassName + " to " + eventListener, cause);
} else { } else {
e.getCause().printStackTrace(); e.getCause().printStackTrace();
} }