summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-11-07 15:36:10 +0000
committerrandomdan <randomdan@localhost>2011-11-07 15:36:10 +0000
commit2230efc49201961e41b96ceb64d87fb19deaf850 (patch)
treee3c8b03fae4e659ccf1e24cd7153ac76342d639c
parentMake many things use variables instead of preread values (diff)
downloadproject2-2230efc49201961e41b96ceb64d87fb19deaf850.tar.bz2
project2-2230efc49201961e41b96ceb64d87fb19deaf850.tar.xz
project2-2230efc49201961e41b96ceb64d87fb19deaf850.zip
Log errors from TaskHost
-rw-r--r--project2/common/taskHost.cpp1
-rw-r--r--project2/console/consoleAppEngine.cpp22
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 *