Skip to content

Commit

Permalink
SQL: Improve error reporting of failed exec(). #2693
Browse files Browse the repository at this point in the history
  • Loading branch information
ckamm committed Jan 29, 2015
1 parent 6fa73e0 commit cd0ad21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libsync/ownsql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ bool SqlQuery::exec()
} while( (n < SQLITE_REPEAT_COUNT) && ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED)));
_errId = rc;

if (_errId != SQLITE_DONE && _errId != SQLITE_ROW) {
_error = QString::fromUtf8(sqlite3_errmsg(_db));
qDebug() << "Sqlite exec statement error:" << _errId << _error << "in" <<_sql;
}
return (_errId == SQLITE_DONE); // either SQLITE_ROW or SQLITE_DONE
}

Expand Down

0 comments on commit cd0ad21

Please sign in to comment.