"vscode:/vscode.git/clone" did not exist on "ec17136e6ed7d6be9a60462cc0e3d2d3cba37320"
Unverified Commit 72e7b57a authored by zolinthecow's avatar zolinthecow Committed by GitHub
Browse files

[Bug] Catch any errors caused by parsing json schema (#1776)

parent 87a7cfa0
...@@ -73,9 +73,16 @@ class FSMCache(BaseToolCache): ...@@ -73,9 +73,16 @@ class FSMCache(BaseToolCache):
def init_value(self, key): def init_value(self, key):
key_type, key_string = key key_type, key_string = key
if key_type == "json": if key_type == "json":
regex = build_regex_from_schema( try:
key_string, whitespace_pattern=self.constrained_json_whitespace_pattern regex = build_regex_from_schema(
) key_string,
whitespace_pattern=self.constrained_json_whitespace_pattern,
)
except NotImplementedError as e:
logger.warning(
f"skip invalid json schema: json_schema={key_string}, {e=}"
)
return None, key_string
elif key_type == "regex": elif key_type == "regex":
regex = key_string regex = key_string
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment