Print a distinct warning for SQLITE_PROTOCOL

This commit is contained in:
Eelco Dolstra 2013-10-16 14:27:36 +02:00
parent d05bf04444
commit 7cdefdbe73

View file

@ -49,11 +49,15 @@ static void throwSQLiteError(sqlite3 * db, const format & f)
{ {
int err = sqlite3_errcode(db); int err = sqlite3_errcode(db);
if (err == SQLITE_BUSY || err == SQLITE_PROTOCOL) { if (err == SQLITE_BUSY || err == SQLITE_PROTOCOL) {
if (err == SQLITE_PROTOCOL)
printMsg(lvlError, "warning: SQLite database is busy (SQLITE_PROTOCOL)");
else {
static bool warned = false; static bool warned = false;
if (!warned) { if (!warned) {
printMsg(lvlError, "warning: SQLite database is busy"); printMsg(lvlError, "warning: SQLite database is busy");
warned = true; warned = true;
} }
}
/* Sleep for a while since retrying the transaction right away /* Sleep for a while since retrying the transaction right away
is likely to fail again. */ is likely to fail again. */
#if HAVE_NANOSLEEP #if HAVE_NANOSLEEP