Skip to content

Commit a91a29d

Browse files
committed
Add a comment explaining about the error key
1 parent 5f8c14c commit a91a29d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/msf/core/rpc/v10/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def call(meth, *args)
7272
if res && [200, 401, 403, 500].include?(res.code)
7373
resp = MessagePack.unpack(res.body)
7474

75+
# Boolean true versus truthy check required here;
76+
# RPC responses such as { "error" => "Here I am" } and { "error" => "" } must be accommodated.
7577
if resp && resp.kind_of?(::Hash) && resp['error'] == true
7678
raise Msf::RPC::ServerException.new(resp['error_code'] || res.code, resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace'])
7779
end

0 commit comments

Comments
 (0)