debian-mirror-gitlab/lib/gitlab/git/wraps_gitaly_errors.rb

20 lines
498 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2018-12-13 13:39:08 +05:30
module Gitlab
module Git
module WrapsGitalyErrors
def wrapped_gitaly_errors(&block)
yield block
rescue GRPC::NotFound => e
2021-06-08 01:23:25 +05:30
raise Gitlab::Git::Repository::NoRepository, e
2018-12-13 13:39:08 +05:30
rescue GRPC::InvalidArgument => e
2021-06-08 01:23:25 +05:30
raise ArgumentError, e
2021-02-22 17:27:13 +05:30
rescue GRPC::DeadlineExceeded => e
2021-06-08 01:23:25 +05:30
raise Gitlab::Git::CommandTimedOut, e
2018-12-13 13:39:08 +05:30
rescue GRPC::BadStatus => e
2021-06-08 01:23:25 +05:30
raise Gitlab::Git::CommandError, e
2018-12-13 13:39:08 +05:30
end
end
end
end