SpigotPluginManager icon indicating copy to clipboard operation
SpigotPluginManager copied to clipboard

Print the stack trace when a plugin fails to load due to an exception thrown from its constructor

Open zhro opened this issue 3 years ago • 1 comments

I've been having issues using this plugin manager for development where the plugin fails to load due to an exception being thrown from the plugin's constructor. SpigotPluginManager would swallow the exception and simply report PM | Could not load the plugin <name>. (Invalid plugin file), which did not provide any useful information as to where the error occurred.

I added a simple call to printStackTrace() in the loadPlugin() method to fix this. There are some other exceptions nearby that don't print a stack trace either, but I don't have any tests for them, and further modifications are outside the scope of my current use case.

zhro avatar Oct 03 '22 08:10 zhro

Would and nice if you could move the e.printStackTrace() up one line so it's above the comment like everywhere else and also add one in the catch block of the UnknownDependencyException as well

Lenni0451 avatar Oct 03 '22 16:10 Lenni0451