Better reporting of unknown exceptions in some cases.
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Sep 2014 21:12:54 +0000 (22:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Sep 2014 21:12:54 +0000 (22:12 +0100)
src/tools/dcpomatic.cc

index 09aebd39ce3f953c48d3a2950117ab78f5957519..6b7ad027303392c638fffc043916150ef2b266d8 100644 (file)
@@ -798,12 +798,21 @@ class App : public wxApp
                return true;
        }
 
+       /* An unhandled exception has occurred inside the main event loop */
        bool OnExceptionInMainLoop ()
        {
-               error_dialog (0, _("An unknown exception occurred.  Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."));
+               try {
+                       throw;
+               } catch (exception& e) {
+                       error_dialog (0, wxString::Format (_("An exception occurred (%s).  Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."), e.what ()));
+               } catch (...) {
+                       error_dialog (0, _("An unknown exception occurred.  Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."));
+               }
+
+               /* This will terminate the program */
                return false;
        }
-               
+       
        void OnUnhandledException ()
        {
                error_dialog (0, _("An unknown exception occurred.  Please report this problem to the DCP-o-matic author (carl@dcpomatic.com)."));