]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3728] Catch boost and std exceptions in kea-lfc.
authorMarcin Siodelski <marcin@isc.org>
Thu, 26 Feb 2015 20:56:15 +0000 (21:56 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 26 Feb 2015 20:56:15 +0000 (21:56 +0100)
src/bin/lfc/lfc_controller.cc
src/bin/lfc/main.cc

index 4cf18065fe2145e111076498e3e4aa64829edf62..25bcd5a313846fff95eb01c656469a29842e73e8 100644 (file)
@@ -115,7 +115,7 @@ LFCController::launch(int argc, char* argv[], const bool test_mode) {
             } else {
                 processLeases<Lease6, CSVLeaseFile6, Lease6Storage>();
             }
-        } 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());
index edc3d435e530216619cebc8ff86d5e73342a3d83..943a4c5ef7c53a55c26a10ed1eb7560e5af6208e 100644 (file)
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
 #include <lfc/lfc_controller.h>
 #include <exceptions/exceptions.h>
 #include <log/logger_support.h>
 #include <log/logger_manager.h>
-#include <config.h>
+#include <boost/exception/diagnostic_information.hpp>
+#include <boost/exception_ptr.hpp>
 #include <iostream>
 
 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;
     }