Exception: Armature::Run::CommandFailureError

Inherits:
Error
  • Object
show all
Defined in:
lib/armature/run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, command, output) ⇒ CommandFailureError

Returns a new instance of CommandFailureError.



12
13
14
15
16
17
# File 'lib/armature/run.rb', line 12

def initialize(status, command, output)
  @status = status
  @command = command
  @output = output
  super("Command '#{@command.first}' failed with #{@status}")
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



9
10
11
# File 'lib/armature/run.rb', line 9

def command
  @command
end

#outputObject (readonly)

Returns the value of attribute output.



10
11
12
# File 'lib/armature/run.rb', line 10

def output
  @output
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/armature/run.rb', line 8

def status
  @status
end

Instance Method Details

#to_sObject



19
20
21
22
# File 'lib/armature/run.rb', line 19

def to_s
  command_str = Armature::Run.command_to_string(@command)
  "Command failed: #{command_str}\nReturn: #{@status}\nOutput:\n#{@output}\n"
end