X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fapplication.cpp;h=43bb023143679e7fdf5e64d893208f859222d973;hp=ebd928b7b7ce049cd2d33ebcedba2ab8f8d4f190;hb=f042fd992170ee8a50a7f596f1c9cdd9600b8583;hpb=9a327fbe5dbad5edec04641527e65d5e7ea4c568 diff --git a/source/core/application.cpp b/source/core/application.cpp index ebd928b..43bb023 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -1,4 +1,7 @@ +#include #include +#include +#include #include #include "application.h" #include "getopt.h" @@ -53,9 +56,18 @@ int Application::run(int argc, char **argv, void *data) } catch(const exception &e) { - delete app_; + bool handled = false; + if(const Debug::ErrorReporter *er = Debug::ErrorReporter::get_current()) + handled = er->report_uncaught_exception(e); - display_exception(e); + if(!handled) + { + IO::print(IO::cerr, "An uncaught exception occurred.\n"); + IO::print(IO::cerr, " type: %s\n", Debug::demangle(typeid(e).name())); + IO::print(IO::cerr, " what(): %s\n", e.what()); + } + + delete app_; return 124; }