From: Michael Marley Date: Tue, 16 Sep 2014 23:29:12 +0000 (-0400) Subject: Quit on database connection failure X-Git-Tag: 0.11.0~6^2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=8166d1701686588630cae9b44310790d084f8fd7;hp=13db1eb09783ab2220c6609844ef32ad0be75945 Quit on database connection failure Previously, if a Quasselcore was configured to use PostgreSQL but the PostgreSQL connection failed on startup, it would come up unconfigured with SQLite. This patch makes the Quasselcore quit with a fatal error instead. --- diff --git a/src/core/core.cpp b/src/core/core.cpp index 008c5b0a..7068f84e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -380,13 +380,10 @@ bool Core::initStorage(const QString &backend, const QVariantMap &settings, bool return false; // trigger setup process if (storage->setup(settings)) return initStorage(backend, settings, false); - // if setup wasn't successfull we mark the backend as unavailable + // if initialization wasn't successful, we quit to keep from coming up unconfigured case Storage::NotAvailable: - qCritical() << "Selected storage backend is not available:" << backend; - storage->deleteLater(); - _storageBackends.remove(backend); - storage = 0; - return false; + qCritical() << "FATAL: Selected storage backend is not available:" << backend; + exit(EXIT_FAILURE); case Storage::IsReady: // delete all other backends _storageBackends.remove(backend);