From 414bbca0bc2bf20c4f424c2368997a46129b32cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 1 Dec 2017 14:59:22 +0100 Subject: Handle postgresql and sqlite3 libs properly Do not fail to compile when one of them is missing but the other one is not. Raise an error when trying to open a database with the missing library. see #3237 --- src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 284d289..c877e43 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,8 +6,6 @@ #include #include -#include - #ifdef UDNS_FOUND # include #endif @@ -90,7 +88,8 @@ int main(int ac, char** av) #ifdef USE_DATABASE try { open_database(); - } catch (...) { + } catch (const std::exception& e) { + log_error(e.what()); return 1; } #endif -- cgit v1.2.3