From 92542259491a2043a35f466992bc42769801f157 Mon Sep 17 00:00:00 2001 From: ofir-frd <85901822+ofir-frd@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:23:41 +0300 Subject: [PATCH] fix: add error handling for missing review data in PR reviewer --- pr_agent/tools/pr_reviewer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py index 0f4eff22..ff48819f 100644 --- a/pr_agent/tools/pr_reviewer.py +++ b/pr_agent/tools/pr_reviewer.py @@ -229,6 +229,10 @@ class PRReviewer: first_key=first_key, last_key=last_key) github_action_output(data, 'review') + if 'review' not in data: + get_logger().exception("Failed to parse review data", artifact={"data": data}) + return "" + # move data['review'] 'key_issues_to_review' key to the end of the dictionary if 'key_issues_to_review' in data['review']: key_issues_to_review = data['review'].pop('key_issues_to_review')