add try catch

This commit is contained in:
Hussam.lawen
2023-07-18 13:14:01 +03:00
parent f2b74b6970
commit 8fb9affef3

View File

@ -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):
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})