diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-07 10:26:38 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-07 10:26:38 +0200 |
commit | fa097c678cdfead0dc1344e6d32569266da53465 (patch) | |
tree | 2afa3e9673bd6e4dac88621311ad36326bab8cbb | |
parent | 23030439c2cf3b3ad48099eb9a4371b8bf55066f (diff) | |
download | gitlab-ce-fa097c678cdfead0dc1344e6d32569266da53465.tar.gz |
Remove duplicated exception in Ci config
This is a temporary refactoring stub, that is planned to be removed
after removing legacy config processor.
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config.rb | 5 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config_spec.rb | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 46a923161c8..130f5b0892e 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -18,7 +18,7 @@ module Ci initial_parsing validate! - rescue Gitlab::Ci::Config::LoaderError => e + rescue Gitlab::Ci::Config::Loader::FormatError => e raise ValidationError, e.message end diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index 5fc4894311f..b6ce791c0ff 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -5,11 +5,6 @@ module Gitlab def initialize(config) loader = Loader.new(config) - - unless loader.valid? - raise LoaderError, 'Invalid configuration format!' - end - @config = loader.load end diff --git a/spec/lib/gitlab/ci/config_spec.rb b/spec/lib/gitlab/ci/config_spec.rb index 52aafbcaaa6..4d46abe520f 100644 --- a/spec/lib/gitlab/ci/config_spec.rb +++ b/spec/lib/gitlab/ci/config_spec.rb @@ -37,7 +37,8 @@ describe Gitlab::Ci::Config do describe '.new' do it 'raises error' do expect { config }.to raise_error( - Gitlab::Ci::Config::LoaderError, /Invalid configuration format/ + Gitlab::Ci::Config::Loader::FormatError, + /Invalid configuration format/ ) end end |