From 89f1200d6f7bbb84255b56e4325a5751e171a685 Mon Sep 17 00:00:00 2001 From: Hari Date: Tue, 21 Jul 2015 16:55:31 +0530 Subject: [PATCH] Catch std exception in io_service run to print it. Change-Id: Iaf932d13b7921d848e7d341e67819047f71975a8 related-bug: 1476613 --- src/io/event_manager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/io/event_manager.cc b/src/io/event_manager.cc index 03d01f14318..4fc87d33ad1 100644 --- a/src/io/event_manager.cc +++ b/src/io/event_manager.cc @@ -58,6 +58,11 @@ void EventManager::RunWithExceptionHandling() { EVENT_MANAGER_LOG_ERROR("Thrift exception caught : " << except.what() << "; ignoring"); continue; + } catch (std::exception &except) { + static std::string what = except.what(); + EVENT_MANAGER_LOG_ERROR("Exception caught in io_service run : " + << what); + exit(-1); } catch(...) { EVENT_MANAGER_LOG_ERROR("Exception caught in io_service run : " "bailing out");