13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/javonet-ruby-sdk/core/receiver/receiver_new.rb', line 13
def send_command(message_array)
begin
response_array = CommandSerializer.new.serialize(Interpreter.new.process(message_array))
rescue Exception => e
message = "Error occurred in Javonet Ruby Core: #{e.message}"
puts message
exception_command = Command.new(RuntimeNameJavonet::RUBY, CommandType::EXCEPTION, [])
exception_command = exception_command.add_arg_to_payload(ExceptionType::EXCEPTION)
exception_command = exception_command.add_arg_to_payload(Command.new(RuntimeNameJavonet::RUBY, CommandType::EXCEPTION, ["Ruby Core Error", "Ruby Core Error"]).to_string)
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("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 = CommandSerializer.new.serialize(exception_command)
end
[response_array.length, response_array]
end
|