diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-05 11:17:13 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-09-05 11:19:35 +0300 |
commit | b83fa58f063b0b086b2c4def68835dbec4fd6bcd (patch) | |
tree | 8f2da6f5e94c7ea8093a025499313832c0457fa3 /lib/gitlab | |
parent | d7133d946c0ecd13a2f5be723ccb541f37b8c1f2 (diff) |
Improve extended CI/CD config error messages
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/ci/config/extendable/entry.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/ci/config/extendable/entry.rb b/lib/gitlab/ci/config/extendable/entry.rb index 9bcb0e2c784..f9b258590d9 100644 --- a/lib/gitlab/ci/config/extendable/entry.rb +++ b/lib/gitlab/ci/config/extendable/entry.rb @@ -3,12 +3,12 @@ module Gitlab class Config class Extendable class Entry - MAX_NESTING_LEVELS = 10 - InvalidExtensionError = Class.new(Extendable::ExtensionError) CircularDependencyError = Class.new(Extendable::ExtensionError) NestingTooDeepError = Class.new(Extendable::ExtensionError) + MAX_NESTING_LEVELS = 10 + attr_reader :key def initialize(key, context, parent = nil) @@ -48,22 +48,22 @@ module Gitlab if unknown_extension? raise Entry::InvalidExtensionError, - "Unknown extends key in extended `#{key}`!" + "#{key}: unknown `extends` key" end if invalid_base? raise Entry::InvalidExtensionError, - "Invalid base hash in extended `#{key}`!" + "#{key}: invalid base hash in `extends`" end if nesting_too_deep? raise Entry::NestingTooDeepError, - "`extends` nesting too deep in `#{key}`!" + "#{key}: `extends` nesting too deep" end if circular_dependency? raise Entry::CircularDependencyError, - "Circular dependency detected in extended `#{key}`!" + "#{key}: circular dependency detected in `extends`" end @context[key] = base_hash!.deep_merge(value) |