forked from qt-creator/qt-creator
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 <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user