Any way to detect and get a stack trace the plugin produced?

Discussion in 'Spigot Plugin Development' started by LordSaad44, May 16, 2015.

  1. So I'm making an option in my plugin to automatically detect and send any stack traces produced by itself to me. I have no idea how to detect and get a stack trace the plugin produces that is NOT in a try and catch, any ideas?
  2. *Hate incoming*
    I don't know a way to do this so far. I would try putting everything into a try-catch :/

    Code (Text):
    public void onEnable() {
      try {
      } catch(Exception e) {
        //SEND IT HERE
    (BTW: That was my 100th post)
  3. NOPE...

    BRILLIANT! But does this override ALL plugin unhandled exceptions? I don't want to interfere with stack traces that aren't of my own plugin.
  4. I didn't think of that. I haven't personally tried it, but I would guess that it does; however, you could check if any of the classes causing the exception to be thrown are yours.
  5. Bukkit will handle it before the uncaught handler gets it.
  6. Yes I guess I could check for my plugin's name in the stack trace... I think i can do that... I'll try.
  7. Just put everything into try-catches.
  8. Are you sure? :/

    I double dare you to make a pull request placing every single command in this plugin into a try-catches...
    Yeah, NOT happening.

    I want this exception handling feature because it seems very useful and cool.