From: Marcin Siodelski Date: Thu, 26 Feb 2015 20:56:15 +0000 (+0100) Subject: [3728] Catch boost and std exceptions in kea-lfc. X-Git-Tag: trac3733_base~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a159d2645b8ed7513cd633153280de335db5dc9e;p=thirdparty%2Fkea.git [3728] Catch boost and std exceptions in kea-lfc. --- 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; }