again, more descriptive error messages

This commit is contained in:
kevin zhao
2025-11-12 19:03:15 -05:00
parent 9b3041ffe5
commit ffdebc2937

View File

@@ -154,7 +154,12 @@ fn parse_list_example(list: &ListRef) -> Result<Vec<String>> {
.map(|value| {
value
.unpack_str()
.ok_or_else(|| Error::InvalidExample("example tokens must be strings".to_string()))
.ok_or_else(|| {
Error::InvalidExample(format!(
"example tokens must be strings (got {})",
value.get_type()
))
})
.map(str::to_string)
})
.collect::<Result<_>>()?;