summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/config.rb')
-rw-r--r--lib/gitlab/ci/config.rb15
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