From a159d2645b8ed7513cd633153280de335db5dc9e Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Thu, 26 Feb 2015 21:56:15 +0100 Subject: [PATCH] [3728] Catch boost and std exceptions in kea-lfc. --- src/bin/lfc/lfc_controller.cc | 2 +- src/bin/lfc/main.cc | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/bin/lfc/lfc_controller.cc b/src/bin/lfc/lfc_controller.cc index 4cf18065fe..25bcd5a313 100644 --- a/src/bin/lfc/lfc_controller.cc +++ b/src/bin/lfc/lfc_controller.cc @@ -115,7 +115,7 @@ LFCController::launch(int argc, char* argv[], const bool test_mode) { } else { processLeases(); } - } catch (const isc::Exception& proc_ex) { + } catch (const std::exception& proc_ex) { // We don't want to do the cleanup but do want to get rid of the pid do_rotate = false; LOG_FATAL(lfc_logger, LFC_FAIL_PROCESS).arg(proc_ex.what()); diff --git a/src/bin/lfc/main.cc b/src/bin/lfc/main.cc index edc3d435e5..943a4c5ef7 100644 --- a/src/bin/lfc/main.cc +++ b/src/bin/lfc/main.cc @@ -12,11 +12,13 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. +#include #include #include #include #include -#include +#include +#include #include using namespace std; @@ -37,7 +39,12 @@ int main(int argc, char* argv[]) { try { // 'false' value disables test mode. lfc_controller.launch(argc, argv, false); - } catch (const isc::Exception& ex) { + + } catch (const boost::exception& ex) { + std::cerr << boost::diagnostic_information(ex) << std::endl; + ret = EXIT_FAILURE; + + } catch (const std::exception& ex) { std::cerr << "Service failed: " << ex.what() << std::endl; ret = EXIT_FAILURE; } -- 2.47.3