Exception: Opsicle::Errors::DeployFailed

Inherits:
StandardError
  • Object
show all
Defined in:
lib/opsicle/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(command = nil) ⇒ DeployFailed

Returns a new instance of DeployFailed.



7
8
9
10
# File 'lib/opsicle/errors.rb', line 7

def initialize(command=nil)
  @command = command
  super("#{command_string} failed!")
end

Instance Method Details

#command_stringObject



12
13
14
15
16
17
18
19
20
# File 'lib/opsicle/errors.rb', line 12

def command_string
  command_string = @command ? @command[:name] : 'deploy'

  if command_string == 'execute_recipes' && @command[:args]["recipes"]
    command_string += " (running [#{@command[:args]["recipes"].join(', ')}])"
  end

  command_string
end