Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-26 15:29:35 +0300
committerShinya Maeda <shinya@gitlab.com>2019-07-04 05:53:40 +0300
commit93be669e16b71a00362187a690e573209d80d960 (patch)
tree6fc866212596ae5a2fbde9b917ea944363b7f8fa /app
parent19dc1105524e3d25821670706a750043775588fa (diff)
Refactor pipeline errors_message
Use the shared method in Ci::Pipeline
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/pipeline.rb4
-rw-r--r--app/services/ci/create_pipeline_service.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index fd5aa216174..20ca4a9ab24 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -790,6 +790,10 @@ module Ci
stages.find_by!(name: name)
end
+ def error_messages
+ errors ? errors.full_messages.to_sentence : ""
+ end
+
private
def ci_yaml_from_repo
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index c17712355af..cdcc4b15bea 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -65,7 +65,7 @@ module Ci
def execute!(*args, &block)
execute(*args, &block).tap do |pipeline|
unless pipeline.persisted?
- raise CreateError, pipeline.errors.full_messages.join(',')
+ raise CreateError, pipeline.error_messages
end
end
end