From 28144963dd8479a60c4994aef32f4cc5c26ade1f Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Mon, 25 Sep 2023 08:27:47 +1300 Subject: [PATCH] If LMDB fails to open, display an error with the directory in question. --- src/storage/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 4e8d97540..d2f0a8453 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -191,7 +191,14 @@ impl Storage { // after the database has been launched. builder.map_size(1048576 * 1024 * 24); // 24 GB - let env = builder.open(Profile::current()?.lmdb_dir)?; + let dir = Profile::current()?.lmdb_dir; + let env = match builder.open(&dir) { + Ok(env) => env, + Err(e) => { + tracing::error!("Unable to open LMDB at {}", dir.display()); + return Err(e.into()); + } + }; let mut txn = env.write_txn()?;