diff options
author | randomdan <randomdan@localhost> | 2011-11-07 15:36:10 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-11-07 15:36:10 +0000 |
commit | 5fb84bd62392edc24aaad86a5409db3f4eccda38 (patch) | |
tree | e3c8b03fae4e659ccf1e24cd7153ac76342d639c | |
parent | Make many things use variables instead of preread values (diff) | |
download | project2-5fb84bd62392edc24aaad86a5409db3f4eccda38.tar.bz2 project2-5fb84bd62392edc24aaad86a5409db3f4eccda38.tar.xz project2-5fb84bd62392edc24aaad86a5409db3f4eccda38.zip |
Log errors from TaskHost
-rw-r--r-- | project2/common/taskHost.cpp | 1 | ||||
-rw-r--r-- | project2/console/consoleAppEngine.cpp | 22 |
2 files changed, 19 insertions, 4 deletions
diff --git a/project2/common/taskHost.cpp b/project2/common/taskHost.cpp index 502e273..fa4718b 100644 --- a/project2/common/taskHost.cpp +++ b/project2/common/taskHost.cpp @@ -33,6 +33,7 @@ TaskHost::execute() const } catch (...) { rollbackAll(); + throw; } } diff --git a/project2/console/consoleAppEngine.cpp b/project2/console/consoleAppEngine.cpp index e49825f..ef1a04f 100644 --- a/project2/console/consoleAppEngine.cpp +++ b/project2/console/consoleAppEngine.cpp @@ -1,4 +1,6 @@ #include <pch.hpp> +#include <glibmm/exception.h> +#include <cxxabi.h> #include "consoleAppEngine.h" #include "consoleEnvironment.h" #include "safeMapFind.h" @@ -35,10 +37,22 @@ onCheckFailureHelper(boost::intrusive_ptr<const ParamChecker> pc) void ConsoleApplicationEngine::process() const { - runChecks(); - execute(); - executeViews(boost::bind(&PresenterLoader::createFrom, LoaderBase::getLoader<PresenterLoader, NotSupported>("console"), _1)); - addAppData(headPresenter().get()); + try { + runChecks(); + execute(); + executeViews(boost::bind(&PresenterLoader::createFrom, LoaderBase::getLoader<PresenterLoader, NotSupported>("console"), _1)); + addAppData(headPresenter().get()); + } + catch (const std::exception & e) { + char * buf = __cxxabiv1::__cxa_demangle(typeid(e).name(), NULL, NULL, NULL); + Logger()->messagef(LOG_ERR, "%s: Script errored: %s: %s", __FUNCTION__, buf, e.what()); + free(buf); + } + catch (const Glib::Exception & e) { + char * buf = __cxxabiv1::__cxa_demangle(typeid(e).name(), NULL, NULL, NULL); + Logger()->messagef(LOG_ERR, "%s: Script errored: %s: %s", __FUNCTION__, buf, e.what().c_str()); + free(buf); + } } const Environment * |