From 1a21c038048310cb95f15f47cfd9eaabc1d1f2f3 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 5 Apr 2011 10:05:33 +0000 Subject: QPID-3187: Added exception handling safeguard for timer tasks git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1088951 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/Timer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/sys/Timer.cpp b/cpp/src/qpid/sys/Timer.cpp index 85e410860d..fdb2e8c6bb 100644 --- a/cpp/src/qpid/sys/Timer.cpp +++ b/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 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. -- cgit v1.2.1