Class: PuppetEditorServices::Handler::JsonRPC
- Defined in:
- lib/puppet_editor_services/handler/json_rpc.rb
Direct Known Subclasses
PuppetLanguageServer::DisabledMessageHandler, PuppetLanguageServer::MessageHandler
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#handle(json_rpc_message, context = {}) ⇒ Object
context request => original request.
-
#unhandled_exception(error, options) ⇒ Object
abstract
options source :request, :notification etc.
Methods inherited from Base
Constructor Details
This class inherits a constructor from PuppetEditorServices::Handler::Base
Instance Method Details
#handle(json_rpc_message, context = {}) ⇒ Object
context
request => original request
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/puppet_editor_services/handler/json_rpc.rb', line 20 def handle(, context = {}) case when ::PuppetEditorServices::Protocol::JsonRPCMessages::RequestMessage return handle_request(, context) when ::PuppetEditorServices::Protocol::JsonRPCMessages::NotificationMessage return handle_notification(, context) when ::PuppetEditorServices::Protocol::JsonRPCMessages::ResponseMessage return handle_response(, context) else PuppetEditorServices.(:error, "Unknown JSON RPC message type #{.class}") end false end |
#unhandled_exception(error, options) ⇒ Object
This method is abstract.
options
source :request, :notification etc.
message JSON Message that caused the error
error Actual ruby error
14 15 16 |
# File 'lib/puppet_editor_services/handler/json_rpc.rb', line 14 def unhandled_exception(error, ) PuppetEditorServices.(:error, "Unhandled exception from #{[:source]}. JSON Message #{[:message]}: #{error.inspect}\n#{error.backtrace}") end |