Commit 2243f0e3 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add IncludeError exception and use it in CI config

parent 5f502c3a
......@@ -13,10 +13,10 @@ module Gitlab
@global = Entry::Global.new(@config)
@global.compose!
rescue Loader::FormatError, Extendable::ExtensionError => e
rescue Loader::FormatError,
Extendable::ExtensionError,
External::Processor::IncludeError => e
raise Config::ConfigError, e.message
rescue External::Processor::FileError => e
raise ::Gitlab::Ci::YamlProcessor::ValidationError, e.message
end
def valid?
......
......@@ -5,7 +5,8 @@ module Gitlab
class Config
module External
class Processor
FileError = Class.new(StandardError)
IncludeError = Class.new(StandardError)
FileError = Class.new(IncludeError)
def initialize(values, project, sha)
@values = values
......
......@@ -200,7 +200,7 @@ describe Gitlab::Ci::Config do
it 'raises error YamlProcessor validationError' do
expect { config }.to raise_error(
::Gitlab::Ci::YamlProcessor::ValidationError,
described_class::ConfigError,
"Local file 'invalid' is not valid."
)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment