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.


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

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


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

def clicmd
  @clicmd
end

#codeObject (readonly)

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


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

def code
  @code
end

#infoObject (readonly)

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


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

def info
  @info
end

#methodObject (readonly)

The method that failed.


34
35
36
# File 'lib/msf/core/post/windows/cli_parse.rb', line 34

def method
  @method
end

Instance Method Details

#to_sObject

Convert a ParseError to a string.


29
30
31
# File 'lib/msf/core/post/windows/cli_parse.rb', line 29

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