Class: PipeRpc::Client::Request::ErrorResponse
- Inherits:
-
ErrorResponse
- Object
- ErrorResponse
- PipeRpc::Client::Request::ErrorResponse
- Defined in:
- lib/pipe_rpc/client_request_error_response.rb
Instance Attribute Summary
Attributes inherited from ErrorResponse
Instance Method Summary collapse
-
#initialize(request, body) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #to_result ⇒ Object
Methods inherited from ErrorResponse
Constructor Details
#initialize(request, body) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
5 6 7 8 |
# File 'lib/pipe_rpc/client_request_error_response.rb', line 5 def initialize(request, body) @request = request super body end |
Instance Method Details
#to_result ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pipe_rpc/client_request_error_response.rb', line 10 def to_result case @code when -32601 then no_method_error when -32602 then argument_error when -32603 then internal_error when -32604 then no_server_error when -32605 then reflected_error else unknown_error end end |