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(method, einfo, ecode = nil) ⇒ RequestError

Returns a new instance of RequestError.


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

def initialize(method, einfo, ecode=nil)
  @method = method
  @result = einfo
  @code   = ecode || einfo
end

Instance Attribute Details

#codeObject (readonly)

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


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

def code
  @code
end

#methodObject (readonly)

The method that failed.


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

def method
  @method
end

#resultObject (readonly)

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


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

def result
  @result
end

Instance Method Details

#to_sObject


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

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