]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/application.cpp
Remove the custom demangle function and use GCC's abi::__cxa_demangle instead
[libs/core.git] / source / core / application.cpp
index 0ef3443e8eac4fab7173b15df42c9cd1360b4e88..a49802350f2f7d655125d8ab0480d9e41370c72a 100644 (file)
@@ -6,6 +6,7 @@ Distributed under the LGPL
 */
 #include <signal.h>
 #include <iostream>
+#include "../debug/demangle.h"
 #include "../time/units.h"
 #include "../time/utils.h"
 #include "application.h"
@@ -40,16 +41,16 @@ int Application::run(int argc, char **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;
-       }
+               try
+               {
+                       app_=reg_app_->create_app(argc, argv);
+               }
+               catch(const UsageError &e)
+               {
+                       reg_app_->usage(e.what(), argv[0], e.get_brief());
+                       return 1;
+               }
 
-       try
-       {
                int result=app_->main();
                delete app_;
                return result;
@@ -57,10 +58,10 @@ int Application::run(int argc, char **argv)
        catch(const exception &e)
        {
                cerr<<"An uncaught exception occurred.\n";
-               cerr<<"  type:   "<<typeid(e).name()<<'\n';
+               cerr<<"  type:   "<<Debug::demangle(typeid(e).name())<<'\n';
                cerr<<"  what(): "<<e.what()<<'\n';
                delete app_;
-               throw;
+               return 124;
        }
 }