Class: PipeRpc::Client::Request::ErrorResponse

Inherits:
ErrorResponse show all
Defined in:
lib/pipe_rpc/client_request_error_response.rb

Instance Attribute Summary

Attributes inherited from ErrorResponse

#code, #data, #id, #message

Instance Method Summary collapse

Methods inherited from ErrorResponse

#to_h

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_resultObject



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