Add a comment explaining about the error key

This commit is contained in:
sinn3r 2015-03-08 23:51:43 -05:00
parent 5f8c14c958
commit a91a29d4e5
1 changed files with 2 additions and 0 deletions

View File

@ -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