Improved error message.

This commit is contained in:
Jeff Baskin 2022-12-03 08:26:21 -05:00
parent 8eb916771e
commit 4e4344624e
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ impl MoreThanText {
match create_dir(data_dir).await {
Ok(_) => (),
Err(err) => {
let mut error = DBError::new("failed to initialize");
let mut error = DBError::new("failed to create data directory");
error.add_source(err);
return Err(error);
}
@ -58,7 +58,7 @@ mod init {
match MoreThanText::new("kljsdgfhslkfrh").await {
Ok(_) => assert!(false, "This test should fail to create a data directory"),
Err(err) => {
assert_eq!(err.to_string(), "failed to initialize");
assert_eq!(err.to_string(), "failed to create data directory");
assert!(err.source().is_some(), "Must include the source error.");
}
};