Exception: Tina4Ultipa::GrpcClient::RpcError
- Inherits:
-
StandardError
- Object
- StandardError
- Tina4Ultipa::GrpcClient::RpcError
- Defined in:
- lib/tina4_ultipa/grpc.rb
Overview
Raised by Channel#unary when the peer returns a non-OK grpc-status trailer.
Constant Summary collapse
- GRPC_STATUS_NAMES =
{ 0 => "OK", 1 => "CANCELLED", 2 => "UNKNOWN", 3 => "INVALID_ARGUMENT", 4 => "DEADLINE_EXCEEDED", 5 => "NOT_FOUND", 6 => "ALREADY_EXISTS", 7 => "PERMISSION_DENIED", 8 => "RESOURCE_EXHAUSTED", 9 => "FAILED_PRECONDITION", 10 => "ABORTED", 11 => "OUT_OF_RANGE", 12 => "UNIMPLEMENTED", 13 => "INTERNAL", 14 => "UNAVAILABLE", 15 => "DATA_LOSS", 16 => "UNAUTHENTICATED", }.freeze
Instance Attribute Summary collapse
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#status_name ⇒ Object
readonly
Returns the value of attribute status_name.
Instance Method Summary collapse
-
#initialize(status_code, message) ⇒ RpcError
constructor
A new instance of RpcError.
Constructor Details
#initialize(status_code, message) ⇒ RpcError
Returns a new instance of RpcError.
37 38 39 40 41 |
# File 'lib/tina4_ultipa/grpc.rb', line 37 def initialize(status_code, ) @status_code = status_code @status_name = GRPC_STATUS_NAMES[status_code] || "STATUS_#{status_code}" super("gRPC #{@status_name}: #{}") end |
Instance Attribute Details
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
26 27 28 |
# File 'lib/tina4_ultipa/grpc.rb', line 26 def status_code @status_code end |
#status_name ⇒ Object (readonly)
Returns the value of attribute status_name.
26 27 28 |
# File 'lib/tina4_ultipa/grpc.rb', line 26 def status_name @status_name end |