diff options
author | Matija Čupić <matteeyah@gmail.com> | 2019-06-06 20:49:04 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2019-06-17 21:53:09 +0200 |
commit | 7ac3723be04ba08cb476ba628cb5c1573ca832c9 (patch) | |
tree | a7fe9269e339e4ddd46b196e31a6774ae2675df7 /lib | |
parent | 68a1ba6a296f340fcddf58e5fbd26d51d66bd90b (diff) | |
download | gitlab-ce-7ac3723be04ba08cb476ba628cb5c1573ca832c9.tar.gz |
Backport CE changesmc/feature/required-template-inclusion-single-commit-ce
Backports CE changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14011/
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 |