Exception: Climate::CommandError

Inherits:
Error
  • Object
show all
Defined in:
lib/climate/errors.rb

Overview

Raised by an instance of a Command when something went wrong during execution

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, command_or_class = nil) ⇒ CommandError

Returns a new instance of CommandError.



14
15
16
17
18
# File 'lib/climate/errors.rb', line 14

def initialize(msg=nil, command_or_class=nil)
  @command_class = command_or_class.is_a?(Command) ? command_or_class.class :
    command_or_class
  super(msg)
end

Instance Attribute Details

#command_classObject

The command that raised the error



12
13
14
# File 'lib/climate/errors.rb', line 12

def command_class
  @command_class
end