Exception: RubynCode::IDE::Protocol::JsonRpcError
- Inherits:
-
StandardError
- Object
- StandardError
- RubynCode::IDE::Protocol::JsonRpcError
- Defined in:
- lib/rubyn_code/ide/protocol.rb
Overview
Raise from a handler to emit a JSON-RPC error response with a specific code. The dispatcher catches this and converts it to a proper ‘error` envelope — handlers don’t have to know how to write to the wire. Use this instead of returning ‘{ ’error’ => … }‘ as the handler result, which the dispatcher would otherwise serialize as a successful `result` payload (the very bug this class fixes).
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ JsonRpcError
constructor
A new instance of JsonRpcError.
Constructor Details
#initialize(code, message) ⇒ JsonRpcError
Returns a new instance of JsonRpcError.
33 34 35 36 |
# File 'lib/rubyn_code/ide/protocol.rb', line 33 def initialize(code, ) super() @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
31 32 33 |
# File 'lib/rubyn_code/ide/protocol.rb', line 31 def code @code end |