X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fapplication.cpp;h=47c176bd8a882a6869df467e7330f2274bfcc5e4;hp=1012ea20f8b3ae400ead7b23fec92af737e8c2c2;hb=f6147f00575bdf6e6b53c2ab81161f5f73d0ab84;hpb=7ff2cc6e945c770c64d39089a2c27b33305495dd diff --git a/source/core/application.cpp b/source/core/application.cpp index 1012ea2..47c176b 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -1,4 +1,5 @@ -/* +/* $Id$ + This file is part of libmspcore Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL @@ -39,17 +40,28 @@ int Application::run(int argc, char **argv) try { - app_=reg_app_->create_app(argc, argv); + try + { + app_=reg_app_->create_app(argc, argv); + } + catch(const UsageError &e) + { + reg_app_->usage(e.what(), argv[0], e.get_brief()); + return 1; + } + + int result=app_->main(); + delete app_; + return result; } - catch(const UsageError &e) + catch(const exception &e) { - reg_app_->usage(e.what(), argv[0], e.get_brief()); - return 1; + cerr<<"An uncaught exception occurred.\n"; + cerr<<" type: "<main(); - delete app_; - return result; } /**