From ffdebc29376dc98761ea652b2ab91b5976f6de57 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Wed, 12 Nov 2025 19:03:15 -0500 Subject: [PATCH] again, more descriptive error messages --- codex-rs/execpolicy2/src/parser.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/codex-rs/execpolicy2/src/parser.rs b/codex-rs/execpolicy2/src/parser.rs index bb1ef5f746..b82109f77b 100644 --- a/codex-rs/execpolicy2/src/parser.rs +++ b/codex-rs/execpolicy2/src/parser.rs @@ -154,7 +154,12 @@ fn parse_list_example(list: &ListRef) -> Result> { .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::>()?;