Skip to content

Commit

Permalink
If LMDB fails to open, display an error with the directory in question.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Sep 27, 2023
1 parent 3b858e2 commit 2814496
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;

Expand Down

0 comments on commit 2814496

Please sign in to comment.