diff --git a/infos/src/main.rs b/infos/src/main.rs index 3f41b7d42..1ebf39969 100644 --- a/infos/src/main.rs +++ b/infos/src/main.rs @@ -200,6 +200,11 @@ fn run(opt: Opt) -> anyhow::Result<()> { let mut options = EnvOpenOptions::new(); options.map_size(opt.database_size.get_bytes() as usize); + // Return an error if the database does not exist. + if !opt.database.exists() { + anyhow::bail!("The database ({}) does not exist.", opt.database.display()); + } + // Open the LMDB database. let index = Index::new(options, opt.database)?; let rtxn = index.read_txn()?;