My application is bug-free, of course, but just in case it contains any bottom values I want to put in a generic exception catcher which will at least pop up a message box to tell the user what kind of bug to report. Because I'm using gi-gtk I figured that any exceptions after initialisation will happen from inside the Gtk.main
function, so the end of my main
function looks looks something like this:
let executeProgram =
catch Gtk.main $ \e -> do
reportThisBugDialog $ show (e :: SomeException)
-- Code here to try to recover to a known good state
executeProgram
executeProgram
I'm also using Reactive Banana in case that is relevant, but this is outside the FRP code.
However this doesn't capture any exceptions. I put error "Test Exception"
in the handler for "Help About", and my program just exited with a message printed to the console (which my users will not see of course).
How do I catch exceptions that occur inside my code when it is reacting to GTK signals?
main
, assumingGtk.main
itself is). Can you check whether that works for you? (I know it sucks...) – Wheelhouse