class GRPC::BadStatus
BadStatus is an exception class that indicates that an error occurred at either end of a GRPC connection. When raised, it indicates that a status error should be returned to the other end of a GRPC connection; when caught it means that this end received a status error.
Attributes
code[R]
details[R]
metadata[R]
Public Class Methods
new(code, details = 'unknown cause', **kw)
click to toggle source
@param code [Numeric] the status code @param details [String] the details of the exception
Calls superclass method
# File src/ruby/lib/grpc/errors.rb, line 43 def initialize(code, details = 'unknown cause', **kw) super("#{code}:#{details}") @code = code @details = details @metadata = kw end
Public Instance Methods
to_status()
click to toggle source
Converts the exception to a GRPC::Status for use in the networking wrapper layer.
@return [Status] with the same code and details
# File src/ruby/lib/grpc/errors.rb, line 54 def to_status Struct::Status.new(code, details, @metadata) end