From 8fb9affef3a02a9667215e0b5ce2713eacbd02ba Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Tue, 18 Jul 2023 13:14:01 +0300 Subject: [PATCH] add try catch --- pr_agent/git_providers/gitlab_provider.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pr_agent/git_providers/gitlab_provider.py b/pr_agent/git_providers/gitlab_provider.py index 6c889c55..b14775a5 100644 --- a/pr_agent/git_providers/gitlab_provider.py +++ b/pr_agent/git_providers/gitlab_provider.py @@ -87,9 +87,12 @@ class GitLabProvider(GitProvider): return [change['new_path'] for change in self.mr.changes()['changes']] def publish_description(self, pr_title: str, pr_body: str): - self.mr.title = pr_title - self.mr.description = pr_body - self.mr.save() + try: + self.mr.title = pr_title + self.mr.description = pr_body + self.mr.save() + except Exception as e: + logging.exception(f"Could not update merge request {self.id_mr} description: {e}") def publish_comment(self, mr_comment: str, is_temporary: bool = False): comment = self.mr.notes.create({'body': mr_comment})