Class: PuppetEditorServices::Handler::DebugAdapter

Inherits:
Base
  • Object
show all
Defined in:
lib/puppet_editor_services/handler/debug_adapter.rb

Direct Known Subclasses

PuppetDebugServer::MessageHandler

Instance Attribute Summary

Attributes inherited from Base

#protocol

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PuppetEditorServices::Handler::Base

Instance Method Details

#handle(json_rpc_message, context = {}) ⇒ Object

context



19
20
21
22
23
24
25
# File 'lib/puppet_editor_services/handler/debug_adapter.rb', line 19

def handle(json_rpc_message, context = {})
  unless json_rpc_message.is_a?(PuppetEditorServices::Protocol::DebugAdapterMessages::Request)
    PuppetEditorServices.log_message(:error, "Unknown JSON RPC message type #{json_rpc_message.class}")
    return false
  end
  handle_request(json_rpc_message, context)
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/debug_adapter.rb', line 14

def unhandled_exception(error, options)
  PuppetEditorServices.log_message(:error, "Unhandled exception from #{options[:source]}. JSON Message #{options[:message]}: #{error.inspect}\n#{error.backtrace}")
end