Improved error message.
This commit is contained in:
		@@ -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.");
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user