Track Sentry error when namespace cannot be moved

Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8926
This commit is contained in:
Valery Sizov 2019-01-03 23:03:35 +02:00
parent 3a60173738
commit 6670f838b5

View file

@ -289,10 +289,12 @@ module Gitlab
#
def mv_namespace(storage, old_name, new_name)
Gitlab::GitalyClient::NamespaceService.new(storage).rename(old_name, new_name)
rescue GRPC::InvalidArgument
rescue GRPC::InvalidArgument => e
Gitlab::Sentry.track_acceptable_exception(e, extra: { old_name: old_name, new_name: new_name, storage: storage })
false
end
alias_method :mv_directory, :mv_namespace
alias_method :mv_directory, :mv_namespace # Note: ShellWorker uses this alias
def url_to_repo(path)
Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git"