Exception: Msf::Post::Windows::CliParse::ParseError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Msf::Post::Windows::CliParse::ParseError
- Defined in:
- lib/msf/core/post/windows/cli_parse.rb
Overview
Msf::Post::Windows::CliParse::ParseError
Instance Attribute Summary collapse
-
#clicmd ⇒ Object
readonly
The shell command that caused the error, if known.
-
#code ⇒ Object
readonly
The error result that occurred, typically a windows error code.
-
#info ⇒ Object
readonly
The error info that occurred, typically a windows error message.
-
#method ⇒ Object
readonly
The method that failed.
Instance Method Summary collapse
-
#initialize(method, einfo = '', ecode = nil, clicmd = nil) ⇒ ParseError
constructor
Create a new ParseError object.
-
#to_s ⇒ Object
Convert a ParseError to a string.
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
#clicmd ⇒ Object (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 |
#code ⇒ Object (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 |
#info ⇒ Object (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 |
#method ⇒ Object (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_s ⇒ Object
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 |