Catching errors from plugin

Discussion in 'Plugin Development' started by sooon_mitch, Apr 30, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    sooon_mitch

    Bukkit has its own built in API for catching the errors from plugins then printing the stack trace to the console. In my plugin, how can I catch any uncaught errors then take their stack trace and save it into a specific file? The only thing I need is catching the error/stack trace but I can not find any documentation about this. Any help would be appreciated. I already now how to save into a file and stuff like that.
     
  2. Offline

    mine-care

    @sooon_mitch Well i can think of a way by overriding the SimplePluginManager class with a custom one to catch errors first but i WOULD NOT recomend it.
     
  3. Offline

    sooon_mitch

    @mine-care Why would you not recommend? And is there any other "safe" paths?
     
  4. Offline

    mine-care

    @sooon_mitch I would not recomend it because in a case of an update and change in plugin loader class kaboom your plugin is not working, The other litle safer way is to hijack the logger to check for exception messages but that requiers a lot of string processing to break it down to pieces and log the message.
     
  5. Offline

    mrCookieSlime

Thread Status:
Not open for further replies.

Share This Page