Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Snowmite, Apr 24, 2017.
Is there anyway that I could make an event when an exception is thrown into the console?
Try checking out this blog post on setDefaultUncaughtExceptionHandler, by Rod Hilton: http://www.nomachetejuggling.com/2006/06/13/java-5-global-exception-handling/ and creating an event around something like that. I think I looked into something like this a while ago and It wasn;t possible with spigot, but I don't think I tried using this method, so it's worth a shot.
How about you just not have an exception thrown in the first place?
I'm pretty sure @Sharkbait means in other plugins as well, which in that case you can't really control.
a) why are you trying to handle exceptions in other plugins? they're improperly throwing exceptions if you need to do this
b) if a plugin that's not yours is randomly throwing exceptions, why are you using it?
I am not sure, that's what I thought @Skarkbait was implying, maybe for finding buggy plugins, or if you are doing some class injecting/override hack, you might want to do something if it throws an error.