Exception: GDKBox::CommandError

Inherits:
Error
  • Object
show all
Defined in:
lib/gdkbox/shell.rb

Overview

Raised when a shelled-out command exits non-zero.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, status, stderr) ⇒ CommandError

Returns a new instance of CommandError.



10
11
12
13
14
15
# File 'lib/gdkbox/shell.rb', line 10

def initialize(command, status, stderr)
  @command = Array(command)
  @status = status
  @stderr = stderr
  super("Command failed (exit #{status}): #{@command.join(' ')}\n#{stderr}".strip)
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



8
9
10
# File 'lib/gdkbox/shell.rb', line 8

def command
  @command
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/gdkbox/shell.rb', line 8

def status
  @status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



8
9
10
# File 'lib/gdkbox/shell.rb', line 8

def stderr
  @stderr
end