print out actual type in error message

This commit is contained in:
kevin zhao
2025-11-12 19:02:19 -05:00
parent 80c67243df
commit 9b3041ffe5

View File

@@ -93,7 +93,10 @@ fn parse_pattern_token<'v>(value: Value<'v>) -> Result<PatternToken> {
value
.unpack_str()
.ok_or_else(|| {
Error::InvalidPattern("pattern alternative must be a string".to_string())
Error::InvalidPattern(format!(
"pattern alternative must be a string (got {})",
value.get_type()
))
})
.map(str::to_string)
})