rapid7/metasploit-framework — pull request #88 by andurin (2011-12-30 06:09:24+00:00)
Title: RPC Client exception handling 

As in the pull request before:

For keeping the history:
IMHO rpc client should transform the error code from Msf::RPC::Exception into it's own Msf::RPC::ServerException and should not take the msgpack response code.

In deep:
I ran into a '401 invalid auth token' after a token timeout (300s).
RPC Daemon raised a 401 - invalid auth token as expected but rpc client
transformed it to a '200 - invalid auth token' using the successful http
transaction to transport the exception.

HD suggested a small fix that the raise should keep an eye on both: resp['error_code'] OR res.code.