1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-11-24 13:58:53 +01:00

Introduce GitObsRuntimeError exception and use it where appropriate

This commit is contained in:
2025-10-09 09:54:18 +02:00
parent 4fddb4568a
commit 1488f3b873
5 changed files with 11 additions and 3 deletions

View File

@@ -552,10 +552,12 @@ class PullRequest(GiteaModel):
"""
Approve review in a pull request.
"""
from .exceptions import GitObsRuntimeError
if commit:
pr_obj = cls.get(conn, owner, repo, number)
if pr_obj.head_commit != commit:
raise RuntimeError("The pull request '{owner}/{repo}#{number}' has changed during the review")
raise GitObsRuntimeError("The pull request '{owner}/{repo}#{number}' has changed during the review")
if reviewer:
# group review bot is controlled via messages in comments