fix(chat): retain SQL error codes when SQLite supplies no message
This commit is contained in:
1 parent
e28386c868
commit
a4edd34695
1 file changed
+2
-1
@@ -61,7 +61,8 @@ static int db_exec(struct chat_core_ctx* cc, const char* sql) {
|
||||
char* err = NULL;
|
||||
int rc = sqlite3_exec(cc->db, sql, NULL, NULL, &err);
|
||||
if (rc != SQLITE_OK) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "%s: sql error: %s", CC_ID, err);
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "%s: SQL rc=%d (%s) statement=%.120s: %s", CC_ID,
|
||||
rc, sqlite3_errstr(rc), sql, err ? err : sqlite3_errmsg(cc->db));
|
||||
sqlite3_free(err);
|
||||
}
|
||||
return rc;
|
||||
|
||||
Reference in new issue
Block a user