Exception: Climate::CommandError
- Defined in:
- lib/climate/errors.rb
Overview
Raised by an instance of a Command when something went wrong during execution
Direct Known Subclasses
ExitException, HelpNeeded, MissingArgumentError, UnexpectedArgumentError, UnknownCommandError
Instance Attribute Summary collapse
-
#command_class ⇒ Object
readonly
The command that raised the error.
Instance Method Summary collapse
-
#initialize(command_or_class, msg = nil) ⇒ CommandError
constructor
A new instance of CommandError.
Constructor Details
#initialize(command_or_class, msg = nil) ⇒ CommandError
Returns a new instance of CommandError.
14 15 16 17 18 |
# File 'lib/climate/errors.rb', line 14 def initialize(command_or_class, msg=nil) @command_class = command_or_class.is_a?(Command) ? command_or_class.class : command_or_class super(msg) end |
Instance Attribute Details
#command_class ⇒ Object (readonly)
The command that raised the error
12 13 14 |
# File 'lib/climate/errors.rb', line 12 def command_class @command_class end |