From 615b575d911383934fc3ea70e7a937d7d9768822 Mon Sep 17 00:00:00 2001 From: Adrian <68704415+4drian3d@users.noreply.github.com> Date: Sat, 23 Mar 2024 13:51:44 -0500 Subject: [PATCH] [ci skip] Add plugin version info to event exception handler (#1263) --- .../velocitypowered/proxy/event/VelocityEventManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/event/VelocityEventManager.java b/proxy/src/main/java/com/velocitypowered/proxy/event/VelocityEventManager.java index 85bb7cceb..ae0295653 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/event/VelocityEventManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/event/VelocityEventManager.java @@ -33,6 +33,7 @@ import com.velocitypowered.api.event.EventTask; import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.plugin.PluginContainer; +import com.velocitypowered.api.plugin.PluginDescription; import com.velocitypowered.api.plugin.PluginManager; import com.velocitypowered.proxy.event.UntargetedEventHandler.EventTaskHandler; import com.velocitypowered.proxy.event.UntargetedEventHandler.VoidHandler; @@ -621,8 +622,9 @@ public class VelocityEventManager implements EventManager { private static void logHandlerException( final HandlerRegistration registration, final Throwable t) { - logger.error("Couldn't pass {} to {}", registration.eventType.getSimpleName(), - registration.plugin.getDescription().getId(), t); + final PluginDescription pluginDescription = registration.plugin.getDescription(); + logger.error("Couldn't pass {} to {} {}", registration.eventType.getSimpleName(), + pluginDescription.getId(), pluginDescription.getVersion().orElse(""), t); } public boolean shutdown() throws InterruptedException {