From: Olivier Goffart Date: Fri, 30 Oct 2015 13:05:58 +0000 (+0100) Subject: OwnSQL: add asserts in case of error that should not happen X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1463 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3993a7f636f0a06b71eb3cc97cdb7a9818c02221;p=nextcloud-desktop.git OwnSQL: add asserts in case of error that should not happen --- diff --git a/src/libsync/ownsql.cpp b/src/libsync/ownsql.cpp index 0f2c59275..26d8bb5e5 100644 --- a/src/libsync/ownsql.cpp +++ b/src/libsync/ownsql.cpp @@ -138,6 +138,7 @@ void SqlDatabase::close() SQLITE_DO(sqlite3_close(_db) ); if (_errId != SQLITE_OK) { qWarning() << "ERROR When closing DB" << _error; + Q_ASSERT(!"SQLite Close Error"); } _db = 0; } @@ -211,6 +212,7 @@ int SqlQuery::prepare( const QString& sql) if( _errId != SQLITE_OK ) { _error = QString::fromUtf8(sqlite3_errmsg(_db)); qWarning() << "Sqlite prepare statement error:" << _error << "in" <<_sql; + Q_ASSERT(!"SQLITE Prepare error"); } } return _errId;