mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
again, more descriptive error messages
This commit is contained in:
@@ -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<_>>()?;
|
||||
|
||||
Reference in New Issue
Block a user