SpigotMC/BungeeCord — pull request #961 by yawkat (2014-04-08 18:43:56+00:00)
Title: Add ExceptionEvent so plugins can handle exceptions thrown by EventHandlers

Adds an ExceptionEvent which is called when an EventHandler throws an Exception.

- Exceptions in ExceptionEvent handlers will simply be logged.
- An ExceptionEvent can be cancelled and will not be logged in that case (custom logging?).
- It is not possible to find the plugin that owns the handler at the moment because of the way EventHandlers are coded.
- A stack overflow could occur if an ExceptionEvent handler submits another event which causes an error which calls the ExceptionEvent handler which submits another event etc. I doubt this is important, however, because this is very unlikely.
- I personally want this change because I would like to use my own logging system without having to wrap all my event handlers in try-catch blocks.