diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-23 12:57:56 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-23 12:57:56 +0100 |
commit | 6a541571bc6aa1f7777e2d679e1770094596525c (patch) | |
tree | d0dceff76957a75d041f7e9dc50437b38f6148f5 /common/storage_lmdb.cpp | |
parent | f66c6c90d01c3d626d7914a20d1251ae1372c2e6 (diff) | |
download | sink-6a541571bc6aa1f7777e2d679e1770094596525c.tar.gz sink-6a541571bc6aa1f7777e2d679e1770094596525c.zip |
Bring the application down in a controlled fashion if we experience a
critical error.
Diffstat (limited to 'common/storage_lmdb.cpp')
-rw-r--r-- | common/storage_lmdb.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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::function<void(const DataStore::Er | |||
468 | const int rc = mdb_txn_commit(d->transaction); | 468 | const int rc = mdb_txn_commit(d->transaction); |
469 | if (rc) { | 469 | if (rc) { |
470 | abort(); | 470 | abort(); |
471 | Error error(d->name.toLatin1(), ErrorCodes::GenericError, "Error during transaction commit: " + QByteArray(mdb_strerror(rc))); | 471 | Error error(d->name.toLatin1(), ErrorCodes::TransactionError, "Error during transaction commit: " + QByteArray(mdb_strerror(rc))); |
472 | errorHandler ? errorHandler(error) : d->defaultErrorHandler(error); | 472 | errorHandler ? errorHandler(error) : d->defaultErrorHandler(error); |
473 | //If transactions start failing we're in an unrecoverable situation (i.e. out of diskspace). So throw an exception that will terminate the application. | ||
474 | throw std::runtime_error("Fatal error while committing transaction."); | ||
473 | } | 475 | } |
474 | d->transaction = nullptr; | 476 | d->transaction = nullptr; |
475 | 477 | ||