summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2011-04-05 10:05:33 +0000
committerGordon Sim <gsim@apache.org>2011-04-05 10:05:33 +0000
commitd07efc2dc34bae9a5fb99655d38cea23b0cff2bb (patch)
tree8270e560fb1f2605a809d7107cad3186b0365c60
parent46af59d8cf7b8ab05e0a3e4db969d19c791deaed (diff)
downloadqpid-python-d07efc2dc34bae9a5fb99655d38cea23b0cff2bb.tar.gz
QPID-3187: Added exception handling safeguard for timer tasks
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1088951 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/sys/Timer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/sys/Timer.cpp b/qpid/cpp/src/qpid/sys/Timer.cpp
index 85e410860d..fdb2e8c6bb 100644
--- a/qpid/cpp/src/qpid/sys/Timer.cpp
+++ b/qpid/cpp/src/qpid/sys/Timer.cpp
@@ -185,7 +185,11 @@ void Timer::stop()
// Allow subclasses to override behavior when firing a task.
void Timer::fire(boost::intrusive_ptr<TimerTask> t) {
- t->fireTask();
+ try {
+ t->fireTask();
+ } catch (const std::exception& e) {
+ QPID_LOG(error, "Exception thrown by timer task " << t->getName() << ": " << e.what());
+ }
}
// Provided for subclasses: called when a task is droped.