updated error messaging to indicate type

This commit is contained in:
kevin zhao
2025-11-10 22:49:42 -08:00
parent a67521926a
commit ff09321eb1

View File

@@ -123,9 +123,10 @@ fn parse_pattern_token<'v>(value: Value<'v>) -> Result<PatternToken> {
_ => Ok(PatternToken::Alts(tokens)),
}
} else {
Err(Error::InvalidPattern(
"pattern element must be a string or list of strings".to_string(),
))
Err(Error::InvalidPattern(format!(
"pattern element must be a string or list of strings (got {})",
value.get_type()
)))
}
}