Skip to content

Commit 26fa590

Browse files
committed
feat: Improve error message on missing property
1 parent 88c2ed1 commit 26fa590

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl fmt::Display for ConfigError {
230230
ConfigError::Foreign(ref cause) => write!(f, "{cause}"),
231231

232232
ConfigError::NotFound(ref key) => {
233-
write!(f, "configuration property {key:?} not found")
233+
write!(f, "missing configuration field {key:?}")
234234
}
235235

236236
ConfigError::Type {

tests/testsuite/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn test_path_index_bounds() {
2222
assert!(res.is_err());
2323
assert_data_eq!(
2424
res.unwrap_err().to_string(),
25-
str![[r#"configuration property "arr[2]" not found"#]]
25+
str![[r#"missing configuration field "arr[2]""#]]
2626
);
2727
}
2828

@@ -45,7 +45,7 @@ fn test_path_index_negative_bounds() {
4545
assert!(res.is_err());
4646
assert_data_eq!(
4747
res.unwrap_err().to_string(),
48-
str![[r#"configuration property "arr[-1]" not found"#]]
48+
str![[r#"missing configuration field "arr[-1]""#]]
4949
);
5050
}
5151

tests/testsuite/get.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn test_not_found() {
1818
assert!(res.is_err());
1919
assert_data_eq!(
2020
res.unwrap_err().to_string(),
21-
str![[r#"configuration property "not_found" not found"#]]
21+
str![[r#"missing configuration field "not_found""#]]
2222
);
2323
}
2424

0 commit comments

Comments
 (0)