From ff09321eb1620952fd16f8b9cbeb6bee95fe2f77 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Mon, 10 Nov 2025 22:49:42 -0800 Subject: [PATCH] updated error messaging to indicate type --- codex-rs/execpolicy2/src/parser.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codex-rs/execpolicy2/src/parser.rs b/codex-rs/execpolicy2/src/parser.rs index c9df506cd5..1822f18b94 100644 --- a/codex-rs/execpolicy2/src/parser.rs +++ b/codex-rs/execpolicy2/src/parser.rs @@ -123,9 +123,10 @@ fn parse_pattern_token<'v>(value: Value<'v>) -> Result { _ => 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() + ))) } }