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' iscalled before the exception is thrown.