Project

General

Profile

« Previous | Next » 

Revision a8442036

Added by Marc Dequènes over 13 years ago

  • ID a8442036db2fe5fa5d266890411b3608d96758a8

[evol] Protocol/Interface: don't check for existence before node call, it is already done in call and a loss of time

View differences:

lib/cyborghood/cyborg/botnet/protocol.rb
result = {
:reply_message => message
}
if @conversation.bot.interface._is_node?(message.conv_thread.session, message.action_parameters[:node])
begin
result[:action_result] = @conversation.bot.interface._call(message.conv_thread.session,
message.action_parameters[:node],
message.action_parameters[:parameters])
rescue CyberError => e
result[:error] = {
:category => e.category,
:severity => e.severity,
:message => e.message
}
rescue
result[:error] = {
:category => 'unknown',
:severity => :unrecoverable,
:message => $!.to_s
}
end
else
begin
result[:action_result] = @conversation.bot.interface._call(message.conv_thread.session,
message.action_parameters[:node],
message.action_parameters[:parameters])
rescue CyberError => e
result[:error] = {
:category => e.category,
:severity => e.severity,
:message => e.message
}
rescue
result[:error] = {
:category => 'API',
:category => 'unknown',
:severity => :unrecoverable,
:message => "bad node"
:message => $!.to_s
}
end

Also available in: Unified diff