diff --git a/bin/bffhd/main.rs b/bin/bffhd/main.rs index 4507d90..6c4dd02 100644 --- a/bin/bffhd/main.rs +++ b/bin/bffhd/main.rs @@ -122,17 +122,14 @@ fn main() -> anyhow::Result<()> { unimplemented!() } else if matches.is_present("load") { let bffh = Diflouroborane::new(config)?; - if bffh - .users - .load_file(matches.value_of("load").unwrap()) - .is_ok() - { - tracing::info!("loaded users from {}", matches.value_of("load").unwrap()); - } else { + if let Err(error) = bffh.users.load_file(matches.value_of("load").unwrap()) { tracing::error!( - "failed to load users from {}", - matches.value_of("load").unwrap() + "failed to load users from {}: {}", + matches.value_of("load").unwrap(), + error, ); + } else { + tracing::info!("loaded users from {}", matches.value_of("load").unwrap()); } return Ok(()); } else { diff --git a/test/duplicate-users.toml b/test/duplicate-users.toml new file mode 100644 index 0000000..d08c92d --- /dev/null +++ b/test/duplicate-users.toml @@ -0,0 +1,8 @@ +[UniqueUser] +roles = ["foorole", "barrole"] + +[DuplicateUser] +roles = ["somerole"] + +[DuplicateUser] +roles = ["different", "roles"]