From 0f9d55d4f9c012c10dd0c26aa3db2a59bba805c5 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 23 Nov 2023 13:18:17 -0800 Subject: [PATCH] nostrdb/debug: use mdb_strerror in more places instead of codes Signed-off-by: William Casarin --- nostrdb/nostrdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nostrdb/nostrdb.c b/nostrdb/nostrdb.c index ff611dfe..5497468e 100644 --- a/nostrdb/nostrdb.c +++ b/nostrdb/nostrdb.c @@ -2170,13 +2170,13 @@ static int ndb_init_lmdb(const char *filename, struct ndb_lmdb *lmdb, size_t map // index dbs if ((rc = mdb_dbi_open(txn, "note_id", tsid_flags, &lmdb->dbs[NDB_DB_NOTE_ID]))) { - fprintf(stderr, "mdb_dbi_open id failed, error %d\n", rc); + fprintf(stderr, "mdb_dbi_open id failed: %s\n", mdb_strerror(rc)); return 0; } mdb_set_compare(txn, lmdb->dbs[NDB_DB_NOTE_ID], ndb_tsid_compare); if ((rc = mdb_dbi_open(txn, "profile_pk", tsid_flags, &lmdb->dbs[NDB_DB_PROFILE_PK]))) { - fprintf(stderr, "mdb_dbi_open id failed, error %d\n", rc); + fprintf(stderr, "mdb_dbi_open id failed: %s\n", mdb_strerror(rc)); return 0; } mdb_set_compare(txn, lmdb->dbs[NDB_DB_PROFILE_PK], ndb_tsid_compare);