[ci skip] Add plugin version info to event exception handler (#1263)

This commit is contained in:
Adrian
2024-03-23 13:51:44 -05:00
committed by GitHub
parent 716da9eaf6
commit 615b575d91

View File

@@ -33,6 +33,7 @@ import com.velocitypowered.api.event.EventTask;
import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.PostOrder;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.plugin.PluginContainer; import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.PluginDescription;
import com.velocitypowered.api.plugin.PluginManager; import com.velocitypowered.api.plugin.PluginManager;
import com.velocitypowered.proxy.event.UntargetedEventHandler.EventTaskHandler; import com.velocitypowered.proxy.event.UntargetedEventHandler.EventTaskHandler;
import com.velocitypowered.proxy.event.UntargetedEventHandler.VoidHandler; import com.velocitypowered.proxy.event.UntargetedEventHandler.VoidHandler;
@@ -621,8 +622,9 @@ public class VelocityEventManager implements EventManager {
private static void logHandlerException( private static void logHandlerException(
final HandlerRegistration registration, final Throwable t) { final HandlerRegistration registration, final Throwable t) {
logger.error("Couldn't pass {} to {}", registration.eventType.getSimpleName(), final PluginDescription pluginDescription = registration.plugin.getDescription();
registration.plugin.getDescription().getId(), t); logger.error("Couldn't pass {} to {} {}", registration.eventType.getSimpleName(),
pluginDescription.getId(), pluginDescription.getVersion().orElse(""), t);
} }
public boolean shutdown() throws InterruptedException { public boolean shutdown() throws InterruptedException {