about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-28 18:53:09 -0500
committerJune McEnroe <june@causal.agency>2019-12-28 18:53:09 -0500
commitd2b7431680cd96758915751854b627cfaca88062 (patch)
tree3e6deb226df8cd707a2c235dcdb8b247364d64d8
parentDon't insert self-messages (diff)
downloadlitterbox-d2b7431680cd96758915751854b627cfaca88062.tar.gz
litterbox-d2b7431680cd96758915751854b627cfaca88062.zip
Send fts5 errors in response to queries
-rw-r--r--litterbox.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/litterbox.c b/litterbox.c
index 9cc1bb5..f02948e 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -283,7 +283,14 @@ static void querySearch(struct Message *msg) {
 				);
 		}
 	}
-	if (result != SQLITE_DONE) warnx("%s", sqlite3_errmsg(db));
+	if (result != SQLITE_DONE) {
+		const char *errmsg = sqlite3_errmsg(db);
+		if (!strncmp(errmsg, "fts5:", 5)) {
+			format("NOTICE %s :%s\r\n", msg->nick, errmsg);
+		} else {
+			warnx("%s", sqlite3_errmsg(db));
+		}
+	}
 
 	sqlite3_reset(stmt);
 }