From 4108c0fe32aab9ab55cd8cc3bbe155be9ca2672c Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Sat, 9 Nov 2019 21:58:16 +0000 Subject: [PATCH] Emit more descriptive error message when companion plugin fails to load --- .../spongepowered/asm/mixin/transformer/PluginHandle.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/PluginHandle.java b/src/main/java/org/spongepowered/asm/mixin/transformer/PluginHandle.java index ae301f09..31565a5f 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/PluginHandle.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/PluginHandle.java @@ -36,6 +36,8 @@ import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import org.spongepowered.asm.mixin.throwables.CompanionPluginError; import org.spongepowered.asm.service.IMixinService; +import com.google.common.base.Strings; + /** * Convenience wrapper for mixin config plugins */ @@ -89,12 +91,13 @@ class PluginHandle { PluginHandle(MixinConfig parent, IMixinService service, String pluginClassName) { IMixinConfigPlugin plugin = null; - if (pluginClassName != null) { + if (!Strings.isNullOrEmpty(pluginClassName)) { try { Class pluginClass = service.getClassProvider().findClass(pluginClassName, true); plugin = (IMixinConfigPlugin)pluginClass.newInstance(); } catch (Throwable th) { - th.printStackTrace(); + PluginHandle.logger.error("Error loading companion plugin class [{}] for mixin config [{}]. The plugin may be out of date: {}:{}", + pluginClassName, parent, th.getClass().getSimpleName(), th.getMessage(), th); plugin = null; } }