Class: Struct::BatchResult
- Inherits:
-
Object
- Object
- Struct::BatchResult
- Defined in:
- lib/grpc/generic/active_call.rb
Overview
BatchResult is the struct returned by calls to call#start_batch.
Instance Method Summary collapse
-
#check_status ⇒ Object
check_status returns the status, raising an error if the status is non-nil and not OK.
Instance Method Details
#check_status ⇒ Object
check_status returns the status, raising an error if the status is non-nil and not OK.
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/grpc/generic/active_call.rb', line 38 def check_status return nil if status.nil? fail GRPC::Cancelled if status.code == GRPC::Core::StatusCodes::CANCELLED if status.code != GRPC::Core::StatusCodes::OK GRPC.logger.debug("Failing with status #{status}") # raise BadStatus, propagating the metadata if present. md = status. with_sym_keys = Hash[md.each_pair.collect { |x, y| [x.to_sym, y] }] fail GRPC::BadStatus.new(status.code, status.details, **with_sym_keys) end status end |