Exception: Cli::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Cli::Error
- Defined in:
- lib/cli/errors.rb
Direct Known Subclasses
UnknownModelError, UnknownUUIDError, UnsupportedArchError, UnsupportedHypervisorError
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(msg, exit_code = 1) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, exit_code = 1) ⇒ Error
Returns a new instance of Error.
6 7 8 9 |
# File 'lib/cli/errors.rb', line 6 def initialize(msg, exit_code=1) super(msg) @exit_code = exit_code end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
5 6 7 |
# File 'lib/cli/errors.rb', line 5 def exit_code @exit_code end |
Class Method Details
.raise(msg, exit_code) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/cli/errors.rb', line 11 def self.raise(msg, exit_code) Kernel.raise(if msg.is_a?(self) msg else self.new(msg, exit_code) end) end |