diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2015-11-19 22:57:06 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2015-11-19 22:57:06 +0000 |
commit | 0383f84d88d95183638d0e227f3446974eb4e387 (patch) | |
tree | b9e52ec4feafe065e044aaec6e7c22a42c7bbdfd /app/models | |
parent | 68d4ab2381ebfe4ad53910a6f1ce6de311c28f8f (diff) | |
parent | 8248314bc9256d3a0252ad6322df098edca7385a (diff) | |
download | gitlab-ce-0383f84d88d95183638d0e227f3446974eb4e387.tar.gz |
Merge branch 'ci-yaml-validation' into 'master'
Commits without .gitlab-ci.yml are marked as skipped
- Commits without .gitlab-ci.yml are marked as skipped
- Save detailed error when YAML syntax
This also fixes: #3521 #3546
/cc @jacobvosmaer
See merge request !1827
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/commit.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 33b57173928..971e899de84 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -188,13 +188,13 @@ module Ci end def config_processor + return nil unless ci_yaml_file @config_processor ||= Ci::GitlabCiYamlProcessor.new(ci_yaml_file, gl_project.path_with_namespace) - rescue Ci::GitlabCiYamlProcessor::ValidationError => e + rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e save_yaml_error(e.message) nil - rescue Exception => e - logger.error e.message + "\n" + e.backtrace.join("\n") - save_yaml_error("Undefined yaml error") + rescue + save_yaml_error("Undefined error") nil end |