Improve reporting of unhandled exceptions.
authorCarl Hetherington <cth@carlh.net>
Tue, 3 Nov 2015 22:23:32 +0000 (22:23 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 3 Nov 2015 22:23:32 +0000 (22:23 +0000)
src/tools/dcpomatic.cc

index 47237eee6de872fe607d98b653893f6cffc986fa..28198a68564411f81c5bb295a2a8a031a0ae57a2 100644 (file)
@@ -926,8 +926,7 @@ private:
                return true;
        }
 
-       /* An unhandled exception has occurred inside the main event loop */
-       bool OnExceptionInMainLoop ()
+       void report_exception ()
        {
                try {
                        throw;
@@ -951,14 +950,19 @@ private:
                } catch (...) {
                        error_dialog (0, _("An unknown exception occurred.") + "  " + REPORT_PROBLEM);
                }
+       }
 
+       /* An unhandled exception has occurred inside the main event loop */
+       bool OnExceptionInMainLoop ()
+       {
+               report_exception ();
                /* This will terminate the program */
                return false;
        }
 
        void OnUnhandledException ()
        {
-               error_dialog (0, _("An unknown exception occurred.") + "  " + REPORT_PROBLEM);
+               report_exception ();
        }
 
        void idle ()