Fix2 rpc exception handling

HD suggested a small tweak to use error_code OR res.code for the raise
This commit is contained in:
andurin 2011-12-30 07:05:26 +01:00
parent 7b4de2380f
commit 898df592be
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ class Client
resp = MessagePack.unpack(res.body)
if resp and resp.kind_of?(::Hash) and resp['error'] == true
raise Msf::RPC::ServerException.new(resp['error_code'], resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace'])
raise Msf::RPC::ServerException.new(resp['error_code'] || res.code, resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace'])
end
return resp