Exception: Msf::RPC::Exception

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/msf/core/rpc/v10/constants.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message, http_msg = nil) ⇒ void

Initializes Exception.

Parameters:

  • code (Integer)

    An error code.

  • message (String)

    An error message.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/msf/core/rpc/v10/constants.rb', line 16

def initialize(code, message, http_msg = nil)
  self.code    = code
  self.message = message
  self.http_msg = http_msg
  self.http_msg ||= case self.code
                    when 400
                      'Bad Request'
                    when 401
                      'Unauthorized'
                    when 403
                      'Forbidden'
                    when 404
                      'Not Found'
                    when 500
                      'Internal Server Error'
                    else
                      'Unknown Error'
                    end
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



9
10
11
# File 'lib/msf/core/rpc/v10/constants.rb', line 9

def code
  @code
end

#http_msgObject

Returns the value of attribute http_msg.



9
10
11
# File 'lib/msf/core/rpc/v10/constants.rb', line 9

def http_msg
  @http_msg
end

#messageObject

Returns the value of attribute message.



9
10
11
# File 'lib/msf/core/rpc/v10/constants.rb', line 9

def message
  @message
end