From 015d9ccbae576049e392b4dbc3017e00d8df3c49 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 7 Jul 2007 17:51:16 +0000 Subject: [PATCH] Trap and explain uncaught exceptions --- source/core/application.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/source/core/application.cpp b/source/core/application.cpp index 0e93a9c..0ef3443 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -48,9 +48,20 @@ int Application::run(int argc, char **argv) return 1; } - int result=app_->main(); - delete app_; - return result; + try + { + int result=app_->main(); + delete app_; + return result; + } + catch(const exception &e) + { + cerr<<"An uncaught exception occurred.\n"; + cerr<<" type: "<