summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-06-06 20:49:04 +0200
committerMatija Čupić <matteeyah@gmail.com>2019-06-06 20:49:04 +0200
commit47f9236ead2c30cc3842ba6e4e22aee06b87f366 (patch)
tree7c421c0ad58aaa713583be2b4fe7e3e9d47b1229
parent68a1ba6a296f340fcddf58e5fbd26d51d66bd90b (diff)
downloadgitlab-ce-mc/feature/required-template-inclusion-ce.tar.gz
Backports CE changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14011/
-rw-r--r--lib/gitlab/ci/config.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb
index f187e456993..3e03ff52ad2 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,13 @@ module Gitlab
user: user,
expandset: Set.new).perform
end
+
+ # Overriden in EE
+ def rescue_errors
+ RESCUE_ERRORS
+ end
end
end
end
+
+Gitlab::Ci::Config.prepend(EE::Gitlab::Ci::Config)