diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-06-18 08:04:32 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-06-18 08:04:32 +0000 |
commit | 077bb1b299196a5f500121c6f60d22026d3407b5 (patch) | |
tree | 14b8f8de0b421e3a99eb42bb544c7fc983905820 /lib | |
parent | 289ca35df404b9600d1917b6b417126dbcf47414 (diff) | |
parent | 7ac3723be04ba08cb476ba628cb5c1573ca832c9 (diff) | |
download | gitlab-ce-077bb1b299196a5f500121c6f60d22026d3407b5.tar.gz |
Merge branch 'mc/feature/required-template-inclusion-single-commit-ce' into 'master'
Enforce template inclusion in pipelines - CE
See merge request gitlab-org/gitlab-ce!29296
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/config.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index f187e456993..a0275515906 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -8,6 +8,12 @@ module Gitlab class Config ConfigError = Class.new(StandardError) + RESCUE_ERRORS = [ + Gitlab::Config::Loader::FormatError, + Extendable::ExtensionError, + External::Processor::IncludeError + ].freeze + def initialize(config, project: nil, sha: nil, user: nil) @config = Config::Extendable .new(build_config(config, project: project, sha: sha, user: user)) @@ -15,9 +21,7 @@ module Gitlab @global = Entry::Global.new(@config) @global.compose! - rescue Gitlab::Config::Loader::FormatError, - Extendable::ExtensionError, - External::Processor::IncludeError => e + rescue *rescue_errors => e raise Config::ConfigError, e.message end @@ -83,6 +87,11 @@ module Gitlab user: user, expandset: Set.new).perform end + + # Overriden in EE + def rescue_errors + RESCUE_ERRORS + end end end end |