Skip to content

Commit 4af4c6c

Browse files
authored
log json decoding errors (#986)
1 parent 80790e9 commit 4af4c6c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

patchwork/steps/SimplifiedLLM/SimplifiedLLM.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from patchwork.common.client.llm.utils import example_json_to_schema
55
from patchwork.common.utils.utils import RetryData, exclude_none_dict, retry
6+
from patchwork.logger import logger
67
from patchwork.step import Step, StepStatus
78
from patchwork.steps.CallLLM.CallLLM import CallLLM
89
from patchwork.steps.ExtractModelResponse.ExtractModelResponse import (
@@ -50,7 +51,8 @@ def __retry_unit(self, prepare_prompt_outputs, call_llm_inputs, retry_data: Retr
5051
try:
5152
json_response = json.loads(response, strict=False)
5253
json_responses.append(json_response)
53-
except json.JSONDecodeError:
54+
except json.JSONDecodeError as e:
55+
logger.error(f"Json to decode: \n{response}\nError: \n{e}")
5456
call_llm.set_status(StepStatus.FAILED, "Failed to decode JSON response")
5557
self.__record_status_or_raise(retry_data, call_llm)
5658
continue

patchwork/steps/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
ModifyCodePB = ModifyCodeOnce
5252
PRPB = PR
5353
ReadPRDiffsPB = ReadPRDiffs
54-
SimplifiedLLMOncePB = SimplifiedLLM
54+
SimplifiedLLMOncePB = SimplifiedLLMOnce
5555

5656
__all__ = [
5757
"AnalyzeImpact",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "patchwork-cli"
3-
version = "0.0.73"
3+
version = "0.0.74"
44
description = ""
55
authors = ["patched.codes"]
66
license = "AGPL"

0 commit comments

Comments
 (0)