From 6a541571bc6aa1f7777e2d679e1770094596525c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 23 Feb 2017 12:57:56 +0100 Subject: Bring the application down in a controlled fashion if we experience a critical error. --- common/storage_lmdb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common/storage_lmdb.cpp') diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index b389e58..cebd3f0 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp @@ -468,8 +468,10 @@ bool DataStore::Transaction::commit(const std::functiontransaction); if (rc) { abort(); - Error error(d->name.toLatin1(), ErrorCodes::GenericError, "Error during transaction commit: " + QByteArray(mdb_strerror(rc))); + Error error(d->name.toLatin1(), ErrorCodes::TransactionError, "Error during transaction commit: " + QByteArray(mdb_strerror(rc))); errorHandler ? errorHandler(error) : d->defaultErrorHandler(error); + //If transactions start failing we're in an unrecoverable situation (i.e. out of diskspace). So throw an exception that will terminate the application. + throw std::runtime_error("Fatal error while committing transaction."); } d->transaction = nullptr; -- cgit v1.2.3