views:

17

answers:

0

Sometimes, the Jambi framework code calls some of my code - for example, when I've connected a button's clicked signal to my own slot, and the button gets clicked.

Now, if my code then throws an exception, Jambi swallows that exception and prints it to the console. I'd like to handle the exception manually (because I want to write it to a file).

Obviously I could wrap in try-catch blocks all my code that might be called from Jambi, but I don't want to.

I've tried:

  • java.lang.Thread.setDefaultUncaughtExceptionHandler
  • System.setOut
  • Console.SetError and Console.SetOut (because I'm using Jambi from C#, via IKVM)

The question, again: How do I write to a file the stacktrace of any exception that's thrown from code called by Jambi, and isn't caught?