diff options
author | Marco Bubke <[email protected]> | 2018-03-29 18:31:02 +0200 |
---|---|---|
committer | Marco Bubke <[email protected]> | 2018-04-04 13:36:25 +0000 |
commit | 5e42bbc7fb20b74c264af2ff4bf773ac4bac4cb1 (patch) | |
tree | b5e7209a20fec9d3e860a70f2409f448e932a458 /src/libs/sqlite/sqlitebasestatement.cpp | |
parent | b6c038924c74c7334935b1695abbbcea82fd56f9 (diff) |
Sqlite: Throw IoError in SqliteStatement::prepareStatement
If we get this any hope is lost any way but we now know why. ;-)
Change-Id: Ic08b104825dc51ce5453203e70a0804265e47330
Reviewed-by: Ivan Donchevskii <[email protected]>
Diffstat (limited to 'src/libs/sqlite/sqlitebasestatement.cpp')
-rw-r--r-- | src/libs/sqlite/sqlitebasestatement.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/sqlite/sqlitebasestatement.cpp b/src/libs/sqlite/sqlitebasestatement.cpp index e67468673a2..995f8ffea03 100644 --- a/src/libs/sqlite/sqlitebasestatement.cpp +++ b/src/libs/sqlite/sqlitebasestatement.cpp @@ -280,7 +280,8 @@ void BaseStatement::checkForPrepareError(int resultCode) const switch (resultCode) { case SQLITE_BUSY: throwStatementIsBusy("SqliteStatement::prepareStatement: database engine was unable to acquire the database locks!"); case SQLITE_ERROR : throwStatementHasError("SqliteStatement::prepareStatement: run-time error (such as a constraint violation) has occurred!"); - case SQLITE_MISUSE: throwStatementIsMisused("SqliteStatement::prepareStatement: was called inappropriately!"); + case SQLITE_MISUSE: throwStatementIsMisused("SqliteStatement::prepareStatement: was called inappropriately!"); + case SQLITE_IOERR: throwIoError("SqliteStatement::prepareStatement: IO error happened!"); } throwUnknowError("SqliteStatement::prepareStatement: unknown error has happened"); @@ -370,6 +371,11 @@ void BaseStatement::throwStatementIsMisused(const char *whatHasHappened) const throw StatementIsMisused(whatHasHappened, sqlite3_errmsg(sqliteDatabaseHandle())); } +void BaseStatement::throwIoError(const char *whatHasHappened) const +{ + throw IoError(whatHasHappened); +} + void BaseStatement::throwConstraintPreventsModification(const char *whatHasHappened) const { throw ConstraintPreventsModification(whatHasHappened, sqlite3_errmsg(sqliteDatabaseHandle())); |