From 47f9236ead2c30cc3842ba6e4e22aee06b87f366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Thu, 6 Jun 2019 20:49:04 +0200 Subject: Backport CE changes Backports CE changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14011/ --- lib/gitlab/ci/config.rb | 17 ++++++++++++++--- 1 file 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) -- cgit v1.2.1