Module: Gitlab::Git::WrapsGitalyErrors

Included in:
Blob, Commit, CommitStats, Conflict::Resolver, Patches::CommitPatches, RemoteMirror, Repository, RepositoryCleaner, Tree, Wiki
Defined in:
lib/gitlab/git/wraps_gitaly_errors.rb

Instance Method Summary collapse

Instance Method Details

#wrapped_gitaly_errors(&block) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'lib/gitlab/git/wraps_gitaly_errors.rb', line 6

def wrapped_gitaly_errors(&block)
  yield block
rescue GRPC::NotFound => e
  raise Gitlab::Git::Repository::NoRepository.new(e)
rescue GRPC::InvalidArgument => e
  raise ArgumentError.new(e)
rescue GRPC::BadStatus => e
  raise Gitlab::Git::CommandError.new(e)
end