Exception: GRPC::BadStatus
- Inherits:
-
StandardError
- Object
- StandardError
- GRPC::BadStatus
- Defined in:
- lib/grpc/errors.rb
Overview
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.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(code, details = 'unknown cause', **kw) ⇒ BadStatus
constructor
A new instance of BadStatus.
-
#to_status ⇒ Status
Converts the exception to a GRPC::Status for use in the networking wrapper layer.
Constructor Details
#initialize(code, details = 'unknown cause', **kw) ⇒ BadStatus
Returns a new instance of BadStatus.
43 44 45 46 47 48 |
# File 'lib/grpc/errors.rb', line 43 def initialize(code, details = 'unknown cause', **kw) super("#{code}:#{details}") @code = code @details = details @metadata = kw end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
39 40 41 |
# File 'lib/grpc/errors.rb', line 39 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
39 40 41 |
# File 'lib/grpc/errors.rb', line 39 def details @details end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
39 40 41 |
# File 'lib/grpc/errors.rb', line 39 def @metadata end |
Instance Method Details
#to_status ⇒ Status
Converts the exception to a GRPC::Status for use in the networking wrapper layer.
54 55 56 |
# File 'lib/grpc/errors.rb', line 54 def to_status Struct::Status.new(code, details, @metadata) end |