Skip to content

Commit 94ea7d9

Browse files
committed
feat: add pipeline schedule play error exception
1 parent a02c577 commit 94ea7d9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gitlab/exceptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ class GitlabJobEraseError(GitlabRetryError):
145145
pass
146146

147147

148+
class GitlabPipelinePlayError(GitlabRetryError):
149+
pass
150+
151+
148152
class GitlabPipelineRetryError(GitlabRetryError):
149153
pass
150154

gitlab/v4/objects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3775,17 +3775,17 @@ def take_ownership(self, **kwargs):
37753775
self._update_attrs(server_data)
37763776

37773777
@cli.register_custom_action("ProjectPipelineSchedule")
3778-
@exc.on_http_error(exc.GitlabOwnershipError)
3778+
@exc.on_http_error(exc.GitlabPipelinePlayError)
37793779
def play(self, **kwargs):
3780-
# https://docs.gitlab.com/ee/api/pipeline_schedules.html#run-a-scheduled-pipeline-immediately # noqa
3781-
"""Play a pipeline schedule immediately.
3780+
"""Trigger a new scheduled pipeline, which runs immediately.
3781+
The next scheduled run of this pipeline is not affected.
37823782
37833783
Args:
37843784
**kwargs: Extra options to send to the server (e.g. sudo)
37853785
37863786
Raises:
37873787
GitlabAuthenticationError: If authentication is not correct
3788-
GitlabOwnershipError: If the request failed
3788+
GitlabPipelinePlayError: If the request failed
37893789
"""
37903790
path = "%s/%s/play" % (self.manager.path, self.get_id())
37913791
server_data = self.manager.gitlab.http_post(path, **kwargs)

0 commit comments

Comments
 (0)