mirror of
https://github.com/allankoechke/SQLiteCpp.git
synced 2026-12-01 01:07:39 +00:00
Add throw exception case in executeStep
Add Comments
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file Backup.cpp
|
||||
* @ingroup SQLiteCpp
|
||||
* @brief Management of a SQLite Database Backup.
|
||||
* @brief Backup is used to backup a database file in a safe and online way.
|
||||
*
|
||||
* Copyright (c) 2015 Shibao HONG (shibaohong@outlook.com)
|
||||
*
|
||||
@@ -74,9 +74,16 @@ Backup::~Backup() noexcept
|
||||
}
|
||||
}
|
||||
|
||||
int Backup::executeStep(const int aNumPage)
|
||||
int Backup::executeStep(const int aNumPage /* = -1 */)
|
||||
{
|
||||
const int res = sqlite3_backup_step(mpSQLiteBackup, aNumPage);
|
||||
if (SQLITE_OK != res && SQLITE_DONE != res &&
|
||||
SQLITE_BUSY != res && SQLITE_LOCKED != res)
|
||||
{
|
||||
std::string strerr("Backup executeStep error with message ");
|
||||
strerr += sqlite3_errstr(res);
|
||||
throw SQLite::Exception(strerr);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user