diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-09-11 16:29:48 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-09-11 16:29:48 +0200 |
commit | 7600a6469bbd2975c80b48e6bb9b95af1e40795f (patch) | |
tree | 09dd4b3e5168ea637968d2825fef17e3731dd791 /lib | |
parent | b470f975e18ce792e78026b7aaa2c4a4fa45e237 (diff) | |
download | gitlab-ce-7600a6469bbd2975c80b48e6bb9b95af1e40795f.tar.gz |
Stack rescue blocks for Gitlab::Ci::Config#initialize
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/config.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index 0ffd1791791..fe98d25af29 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -7,16 +7,14 @@ module Gitlab ConfigError = Class.new(StandardError) def initialize(config, opts = {}) - begin - @config = Config::Extendable - .new(build_config(config, opts)) - .to_hash - - @global = Entry::Global.new(@config) - @global.compose! - rescue Loader::FormatError, Extendable::ExtensionError => e - raise Config::ConfigError, e.message - end + @config = Config::Extendable + .new(build_config(config, opts)) + .to_hash + + @global = Entry::Global.new(@config) + @global.compose! + rescue Loader::FormatError, Extendable::ExtensionError => e + raise Config::ConfigError, e.message rescue ::Gitlab::Ci::External::Processor::FileError => e raise ::Gitlab::Ci::YamlProcessor::ValidationError, e.message end |