Exception: Morpheus::Cli::CommandError
- Inherits:
-
StandardError
- Object
- StandardError
- Morpheus::Cli::CommandError
- Defined in:
- lib/morpheus/cli/errors.rb
Overview
A standard error to raise in your CliCommand classes.
Direct Known Subclasses
AuthorizationRequiredError, CommandAborted, CommandArgumentsError, CommandNotFoundError
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#optparse ⇒ Object
readonly
Returns the value of attribute optparse.
Instance Method Summary collapse
-
#initialize(msg, args = [], optparse = nil, exit_code = nil) ⇒ CommandError
constructor
A new instance of CommandError.
Constructor Details
#initialize(msg, args = [], optparse = nil, exit_code = nil) ⇒ CommandError
Returns a new instance of CommandError.
8 9 10 11 12 13 |
# File 'lib/morpheus/cli/errors.rb', line 8 def initialize(msg, args=[], optparse=nil, exit_code=nil) @args = args @optparse = optparse @exit_code = exit_code # || 1 super(msg) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
6 7 8 |
# File 'lib/morpheus/cli/errors.rb', line 6 def args @args end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
6 7 8 |
# File 'lib/morpheus/cli/errors.rb', line 6 def exit_code @exit_code end |
#optparse ⇒ Object (readonly)
Returns the value of attribute optparse.
6 7 8 |
# File 'lib/morpheus/cli/errors.rb', line 6 def optparse @optparse end |