Fix2 rpc exception handling
HD suggested a small tweak to use error_code OR res.code for the raise
This commit is contained in:
parent
7b4de2380f
commit
898df592be
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue