diff options
Diffstat (limited to 'lib/api/deployments.rb')
-rw-r--r-- | lib/api/deployments.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb index aa1e6bbc952..ee0a026d7ac 100644 --- a/lib/api/deployments.rb +++ b/lib/api/deployments.rb @@ -156,7 +156,11 @@ module API authorize!(:destroy_deployment, deployment) destroy_conditionally!(deployment) do - ::Ci::Deployments::DestroyService.new(user_project, current_user).execute(deployment) + result = ::Ci::Deployments::DestroyService.new(user_project, current_user).execute(deployment) + + if result[:status] == :error + render_api_error!(result[:message], result[:http_status] || 400) + end end end |