Add a comment explaining about the error key
parent
5f8c14c958
commit
a91a29d4e5
|
@ -72,6 +72,8 @@ class Client
|
|||
if res && [200, 401, 403, 500].include?(res.code)
|
||||
resp = MessagePack.unpack(res.body)
|
||||
|
||||
# Boolean true versus truthy check required here;
|
||||
# RPC responses such as { "error" => "Here I am" } and { "error" => "" } must be accommodated.
|
||||
if resp && resp.kind_of?(::Hash) && resp['error'] == true
|
||||
raise Msf::RPC::ServerException.new(resp['error_code'] || res.code, resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace'])
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue