If you want a callback for exceptions thrown, write a small routine, and register it as debugger of your program.

 

So now every time an exception is thrown, the 'throw handler' is
called before the exception is thrown.