From 591078f9c90100b1f6926bdac55877aa864f2238 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 10 Mar 2009 14:38:34 +0000 Subject: added SIGERROR to signal Controller --- src/resolver.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/resolver.cpp') diff --git a/src/resolver.cpp b/src/resolver.cpp index 6d5c777..5e2d862 100644 --- a/src/resolver.cpp +++ b/src/resolver.cpp @@ -34,6 +34,7 @@ #include "resolver.h" #include "log.h" +#include "signalController.h" using ::boost::asio::ip::udp; using ::boost::asio::ip::tcp; @@ -68,7 +69,13 @@ template void ResolveHandler::operator()(const boost::system::error_code& e, const boost::asio::ip::basic_resolver_iterator endpointIt) { if(boost::system::posix_error::success == e) { - callback_(*endpointIt); + try { + callback_(*endpointIt); + } + catch(const std::runtime_error& e) + { + gSignalController.inject(SIGERROR, e.what()); + } } else { cLog.msg(Log::PRIO_ERROR) << "Error while resolving '" << addr_ << "' '" << port_ << "', retrying in 10 sec."; boost::thread(boost::bind(waitAndEnqueue, 10, addr_, port_, callback_, resolv_addr_type_)); -- cgit v1.2.3