From c1eda7305b5bc7e3cc5d54140b160950227b7707 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 9 Oct 2025 16:39:54 +0900 Subject: [PATCH] jmespath search, catch JMESPathTypeError error This error can happend if we search for a key and try to make a value compare and the key does not exist. Perhaps also when they key should return a list --- src/corelibs/json_handling/jmespath_helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelibs/json_handling/jmespath_helper.py b/src/corelibs/json_handling/jmespath_helper.py index 951fd64..7f3537b 100644 --- a/src/corelibs/json_handling/jmespath_helper.py +++ b/src/corelibs/json_handling/jmespath_helper.py @@ -28,6 +28,8 @@ def jmespath_search(search_data: dict[Any, Any] | list[Any], search_params: str) raise ValueError(f"Compile failed: {search_params}: {excp}") from excp except jmespath.exceptions.ParseError as excp: raise ValueError(f"Parse failed: {search_params}: {excp}") from excp + except jmespath.exceptions.JMESPathTypeError as excp: + raise ValueError(f"Search failed with JMESPathTypeError: {search_params}: {excp}") from excp except TypeError as excp: raise ValueError(f"Type error for search_params: {excp}") from excp return search_result