Exception: Msf::Post::Windows::CliParse::ParseError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/msf/core/post/windows/cli_parse.rb

Overview

Msf::Post::Windows::CliParse::ParseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, einfo = '', ecode = nil, clicmd = nil) ⇒ ParseError

Create a new ParseError object. Expects a method name, an error message, an error code, and the command that caused the error.


20
21
22
23
24
25
26
# File 'lib/msf/core/post/windows/cli_parse.rb', line 20

def initialize(method, einfo='', ecode=nil, clicmd=nil)
  @method = method
  @info = einfo
  # try to look up info if not given, but code is?
  @code   = ecode
  @clicmd = clicmd || "Unknown shell command"
end

Instance Attribute Details

#clicmdObject (readonly)

The shell command that caused the error, if known


45
46
47
# File 'lib/msf/core/post/windows/cli_parse.rb', line 45

def clicmd
  @clicmd
end

#codeObject (readonly)

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


42
43
44
# File 'lib/msf/core/post/windows/cli_parse.rb', line 42

def code
  @code
end

#infoObject (readonly)

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


39
40
41
# File 'lib/msf/core/post/windows/cli_parse.rb', line 39

def info
  @info
end

#methodObject (readonly)

The method that failed.


36
37
38
# File 'lib/msf/core/post/windows/cli_parse.rb', line 36

def method
  @method
end

Instance Method Details

#to_sObject

Convert a ParseError to a string.


31
32
33
# File 'lib/msf/core/post/windows/cli_parse.rb', line 31

def to_s
  "#{@method}: Operation failed: #{@info}:#{@code} while running #{@clicmd}"
end