Exception: Rex::Post::Meterpreter::RequestError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/rex/post/meterpreter/packet_dispatcher.rb

Overview

Exception thrown when a request fails.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command_id, einfo, ecode = nil) ⇒ RequestError

Returns a new instance of RequestError.


17
18
19
20
21
22
23
# File 'lib/rex/post/meterpreter/packet_dispatcher.rb', line 17

def initialize(command_id, einfo, ecode=nil)
  command_name = Rex::Post::Meterpreter::CommandMapper.get_command_name(command_id)

  @method = command_name || "##{command_id}"
  @result = einfo
  @code   = ecode || einfo
end

Instance Attribute Details

#codeObject (readonly)

The error result that occurred, typically a windows error code.


36
37
38
# File 'lib/rex/post/meterpreter/packet_dispatcher.rb', line 36

def code
  @code
end

#methodObject (readonly)

The method that failed.


30
31
32
# File 'lib/rex/post/meterpreter/packet_dispatcher.rb', line 30

def method
  @method
end

#resultObject (readonly)

The error result that occurred, typically a windows error message.


33
34
35
# File 'lib/rex/post/meterpreter/packet_dispatcher.rb', line 33

def result
  @result
end

Instance Method Details

#to_sObject


25
26
27
# File 'lib/rex/post/meterpreter/packet_dispatcher.rb', line 25

def to_s
  "#{@method}: Operation failed: #{@result}"
end