12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/hypertube-ruby-sdk/core/receiver/receiver.rb', line 12
def self.send_command(message_array)
begin
response_array = Hypertube::Core::Protocol::CommandSerializer.serialize(Hypertube::Core::Interpreter::Interpreter.process(message_array))
rescue Exception => e
message = "Error occurred in Hypertube::Sdk::RuntimeBridge Ruby Core: #{e.message}"
puts message
exception_command = Hypertube::Utils::Command.new(Hypertube::Utils::RuntimeNameHt::RUBY, Hypertube::Utils::CommandType::EXCEPTION, [])
exception_command = exception_command.add_arg_to_payload(Hypertube::Utils::Exceptions::ExceptionType::EXCEPTION)
exception_command = exception_command.add_arg_to_payload(Hypertube::Utils::Command.new(Hypertube::Utils::RuntimeNameHt::RUBY, Hypertube::Utils::CommandType::EXCEPTION, ["Ruby Core Error", "Ruby Core Error"]).to_s)
exception_command = exception_command.add_arg_to_payload("Ruby Core Error")
exception_command = exception_command.add_arg_to_payload(e.message)
exception_command = exception_command.add_arg_to_payload("Hypertube::Core::Receiver::Receiver")
exception_command = exception_command.add_arg_to_payload("send_command")
exception_command = exception_command.add_arg_to_payload("undefined")
exception_command = exception_command.add_arg_to_payload(__FILE__)
response_array = Hypertube::Core::Protocol::CommandSerializer.serialize(exception_command)
end
[response_array.length, response_array]
end
|