From 42ff121e14f55cbdcff40f7ae488cb9ff7bc6f90 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 3 Sep 2014 22:12:54 +0100 Subject: Better reporting of unknown exceptions in some cases. --- src/tools/dcpomatic.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 09aebd39c..6b7ad0273 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -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).")); -- cgit v1.2.3