Skip to content

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

Open
zhro wants to merge 1 commit into
Lenni0451:masterfrom
zhro:pr-print-exception-on-error
Open

Print the stack trace when a plugin fails to load due to an exception thrown from its constructor#18
zhro wants to merge 1 commit into
Lenni0451:masterfrom
zhro:pr-print-exception-on-error

Conversation

@zhro

@zhro zhro commented Oct 3, 2022

Copy link
Copy Markdown

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.

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

Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants