Code

frontend: Unified error reporting to the client.
[sysdb.git] / src / frontend / query.c
index 9e3b66a3a5c2b55579dccb5fdc4741631930e95d..fa493a6dd04be5a8139c0cae0485d2bea43703c6 100644 (file)
@@ -50,8 +50,7 @@ sdb_fe_list(sdb_conn_t *conn)
                                "buffer to handle LIST command: %s",
                                sdb_strerror(errno, errbuf, sizeof(errbuf)));
 
-               /* XXX: send error message */
-               sdb_connection_send(conn, CONNECTION_ERROR, 0, NULL);
+               sdb_strbuf_sprintf(conn->errbuf, "Out of memory");
                sdb_strbuf_destroy(buf);
                return -1;
        }
@@ -59,7 +58,7 @@ sdb_fe_list(sdb_conn_t *conn)
        if (sdb_store_tojson(buf)) {
                sdb_log(SDB_LOG_ERR, "frontend: Failed to serialize "
                                "store to JSON");
-               sdb_connection_send(conn, CONNECTION_ERROR, 0, NULL);
+               sdb_strbuf_sprintf(conn->errbuf, "Out of memory");
                sdb_strbuf_destroy(buf);
                return -1;
        }