diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-06 06:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-06 06:08:19 +0300 |
commit | 5f4d224e546bdded3f9578e0ac7b30642009c9ab (patch) | |
tree | 117e22bbc1a80c7da6557d22fe7c0f36d1f3cdaf /lib/gitlab/git_access.rb | |
parent | 671755053668642cf00d225825b11cd8abd49126 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r-- | lib/gitlab/git_access.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index ecf45aebb0c..0576d1dd9db 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -47,6 +47,16 @@ module Gitlab :cmd, :changes attr_accessor :container + def self.error_message(key) + self.ancestors.each do |cls| + return cls.const_get('ERROR_MESSAGES', false).fetch(key) + rescue NameError, KeyError + next + end + + raise ArgumentError, "No error message defined for #{key}" + end + def initialize(actor, container, protocol, authentication_abilities:, namespace_path: nil, repository_path: nil, redirected_path: nil, auth_result_type: nil) @actor = actor @container = container @@ -413,13 +423,7 @@ module Gitlab protected def error_message(key) - self.class.ancestors.each do |cls| - return cls.const_get('ERROR_MESSAGES', false).fetch(key) - rescue NameError, KeyError - next - end - - raise ArgumentError, "No error message defined for #{key}" + self.class.error_message(key) end def success_result |