2018-11-09 18:39:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-30 13:37:40 +00:00
|
|
|
module Gitlab
|
|
|
|
module Git
|
|
|
|
module WrapsGitalyErrors
|
|
|
|
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)
|
2020-11-19 15:09:13 +00:00
|
|
|
rescue GRPC::DeadlineExceeded => e
|
|
|
|
raise Gitlab::Git::CommandTimedOut.new(e)
|
2018-10-30 13:37:40 +00:00
|
|
|
rescue GRPC::BadStatus => e
|
|
|
|
raise Gitlab::Git::CommandError.new(e)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|