From 2230efc49201961e41b96ceb64d87fb19deaf850 Mon Sep 17 00:00:00 2001 From: randomdan Date: Mon, 7 Nov 2011 15:36:10 +0000 Subject: Log errors from TaskHost --- project2/common/taskHost.cpp | 1 + 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 +#include +#include #include "consoleAppEngine.h" #include "consoleEnvironment.h" #include "safeMapFind.h" @@ -35,10 +37,22 @@ onCheckFailureHelper(boost::intrusive_ptr pc) void ConsoleApplicationEngine::process() const { - runChecks(); - execute(); - executeViews(boost::bind(&PresenterLoader::createFrom, LoaderBase::getLoader("console"), _1)); - addAppData(headPresenter().get()); + try { + runChecks(); + execute(); + executeViews(boost::bind(&PresenterLoader::createFrom, LoaderBase::getLoader("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 * -- cgit v1.2.3