If database connection fails the main program exits.
authorMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 27 Jun 2010 15:14:47 +0000 (18:14 +0300)
committerMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 27 Jun 2010 15:14:47 +0000 (18:14 +0300)
src/main.cpp

index 3c7321c..c4d4758 100644 (file)
@@ -38,7 +38,11 @@ int main(int argc, char *argv[])
 
     if (DatabaseManager::openDB())
         cout << " Database opened succesfully!" << endl;
-       else cout << " Database connection failed!" << endl;
+    else
+    {
+        cout << " Database connection failed!" << endl;
+        exit(1);
+    }
 
     if (reset || !DbCreator::dbExists())
        {