Class: Momento::Error::GrpcDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/momento/error/grpc_details.rb

Overview

Details about a GRPC error. Returned by ‘response.error.transport_details.grpc`

Examples:

# Information about the underlying GRPC error which
# caused a Momento error response.
puts response.error.transport_details.grpc.details

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grpc) ⇒ GrpcDetails

Returns a new instance of GrpcDetails.

Parameters:

  • grpc (GRPC::BadStatus)

    the GRPC exception to wrap



15
16
17
# File 'lib/momento/error/grpc_details.rb', line 15

def initialize(grpc)
  @grpc = grpc
end

Instance Attribute Details

#grpcGRPC::BadStatus (readonly)

Returns the GRPC exception.

Returns:

  • (GRPC::BadStatus)

    the GRPC exception



12
13
14
# File 'lib/momento/error/grpc_details.rb', line 12

def grpc
  @grpc
end

Instance Method Details

#codeInteger

The GRPC numeric error code

Returns:

  • (Integer)


21
22
23
# File 'lib/momento/error/grpc_details.rb', line 21

def code
  grpc.code
end

#detailsString

Any details about the error provided by GRPC

Returns:

  • (String)


27
28
29
# File 'lib/momento/error/grpc_details.rb', line 27

def details
  grpc.details
end

#metadataHash

Any metadata associated with the GRPC error

Returns:

  • (Hash)


33
34
35
# File 'lib/momento/error/grpc_details.rb', line 33

def 
  grpc.
end