Add IncludeError exception and use it in CI config
This commit is contained in:
parent
5f502c3a82
commit
2243f0e3de
3 changed files with 6 additions and 5 deletions
|
@ -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?
|
||||
|
|
3
lib/gitlab/ci/config/external/processor.rb
vendored
3
lib/gitlab/ci/config/external/processor.rb
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue