Skip to content

Commit

Permalink
Merge pull request #1184 from MaxHoecker/bugfix/suggestions_error_pub…
Browse files Browse the repository at this point in the history
…lish

checking for publish_output in the suggestions tool exception handler
  • Loading branch information
mrT23 authored Aug 28, 2024
2 parents 84dc976 + d9571ee commit 97b48da
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pr_agent/tools/pr_code_suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,15 @@ async def run(self):
get_logger().info('Code suggestions generated for PR, but not published since publish_output is False.')
except Exception as e:
get_logger().error(f"Failed to generate code suggestions for PR, error: {e}")
if self.progress_response:
self.progress_response.delete()
else:
try:
self.git_provider.remove_initial_comment()
self.git_provider.publish_comment(f"Failed to generate code suggestions for PR")
except Exception as e:
pass
if get_settings().config.publish_output:
if self.progress_response:
self.progress_response.delete()
else:
try:
self.git_provider.remove_initial_comment()
self.git_provider.publish_comment(f"Failed to generate code suggestions for PR")
except Exception as e:
pass

def publish_persistent_comment_with_history(self, pr_comment: str,
initial_header: str,
Expand Down

0 comments on commit 97b48da

Please sign in to comment.