diff --git a/src/chat/chat_core.c b/src/chat/chat_core.c index 8317df7e..f7d6f1e9 100644 --- a/src/chat/chat_core.c +++ b/src/chat/chat_core.c @@ -192,7 +192,9 @@ int chat_core_init(struct UTUN_INSTANCE* inst, const char* db_path) { { int rc = sqlite3_get_table(cc->db, "SELECT channel_id,length(CAST(channel_id AS BLOB)) FROM channels ORDER BY created_at ASC", &channels, &rows, &columns, NULL); - if (rc != SQLITE_OK || (rows && columns != 2)) goto fail; + if (rc != SQLITE_OK || (rows && columns != 2)) { + DEBUG_ERROR(DEBUG_CATEGORY_CHAT_SYNC, "chat init: catalog rc=%d rows=%d columns=%d: %s", rc, rows, columns, sqlite3_errmsg(cc->db)); goto fail; + } for (int i = 0; i < rows; i++) { const char *ch = channels[(size_t)(i + 1) * columns], *bytes = channels[(size_t)(i + 1) * columns + 1]; if (!chat_channel_id(ch) || !bytes || strlen(ch) != strtoul(bytes, NULL, 10)) {