From 09a1c613cc4c2f4622ccfbbf7d1205c04e423e2a Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Tue, 22 Sep 2015 17:43:15 +0200 Subject: [PATCH] Improved error handling --- doorlockd/main.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/doorlockd/main.cpp b/doorlockd/main.cpp index ae6cff5..8fa35b9 100644 --- a/doorlockd/main.cpp +++ b/doorlockd/main.cpp @@ -144,20 +144,18 @@ int main(int argc, char** argv) signal(SIGUSR1, signal_handler); signal(SIGUSR2, signal_handler); - l(LogLevel::info, "Starting Doorlock Logic"); - logic = unique_ptr(new Logic(tokenTimeout, - ldapUri, - bindDN, - lockPagePrefix, - serDev)); + l(LogLevel::info, "Starting Doorlock Logic"); try { + logic = unique_ptr(new Logic(tokenTimeout, + ldapUri, + bindDN, + lockPagePrefix, + serDev)); server(port); } - catch (const char* const &ex) { - ostringstream str; - str << "FATAL ERROR: " << ex; - l(str, LogLevel::error); + catch (...) { + l(LogLevel::error, "Fatal error, shutting down"); retval = -1; goto out; }