Skip to content

Commit e7eb395

Browse files
razvanNickLarsenNZ
andauthored
Add key and value to InvalidValueSnafu (#741)
* Add key and value to InvalidValueSnafu * Update src/kvp/mod.rs Co-authored-by: Nick <NickLarsenNZ@users.noreply.github.com> --------- Co-authored-by: Nick <NickLarsenNZ@users.noreply.github.com>
1 parent ca54ab7 commit e7eb395

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/kvp/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ where
3434
InvalidKey { source: KeyError, key: String },
3535

3636
/// Indicates that the value failed to parse.
37-
#[snafu(display("failed to parse value {value:?} of key/value pair"))]
38-
InvalidValue { source: E, value: String },
37+
#[snafu(display("failed to parse value {value:?} of key {key:?}"))]
38+
InvalidValue {
39+
source: E,
40+
key: String,
41+
value: String,
42+
},
3943
}
4044

4145
/// A validated Kubernetes key/value pair.
@@ -109,6 +113,7 @@ where
109113
})?;
110114

111115
let value = T::from_str(value.1.as_ref()).context(InvalidValueSnafu {
116+
key: key.to_string(),
112117
value: value.1.as_ref(),
113118
})?;
114119

0 commit comments

Comments
 (0)