Exception: Pikuri::Lsp::Connection::ServerError
- Inherits:
-
StandardError
- Object
- StandardError
- Pikuri::Lsp::Connection::ServerError
- Defined in:
- lib/pikuri/lsp/connection.rb
Overview
A JSON-RPC error response. Not a bug in pikuri — the server
understood the frame and refused the call.
Instance Attribute Summary collapse
-
#code ⇒ Integer
readonly
JSON-RPC error code, e.g.
-
#data ⇒ Hash, ...
readonly
The
datamember, whose shape each server invents for itself.
Instance Method Summary collapse
-
#initialize(method, error) ⇒ ServerError
constructor
A new instance of ServerError.
Constructor Details
#initialize(method, error) ⇒ ServerError
Returns a new instance of ServerError.
87 88 89 90 91 |
# File 'lib/pikuri/lsp/connection.rb', line 87 def initialize(method, error) @code = error['code'] @data = error['data'] super("#{method} failed: #{error['message']} (code #{@code})") end |
Instance Attribute Details
#code ⇒ Integer (readonly)
Returns JSON-RPC error code, e.g. -32601 for
Method not found.
79 80 81 |
# File 'lib/pikuri/lsp/connection.rb', line 79 def code @code end |
#data ⇒ Hash, ... (readonly)
Returns the data member, whose
shape each server invents for itself.
83 84 85 |
# File 'lib/pikuri/lsp/connection.rb', line 83 def data @data end |