Exception: GDKBox::CommandError
- Defined in:
- lib/gdkbox/shell.rb
Overview
Raised when a shelled-out command exits non-zero.
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
Instance Method Summary collapse
-
#initialize(command, status, stderr) ⇒ CommandError
constructor
A new instance of CommandError.
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
#command ⇒ Object (readonly)
Returns the value of attribute command.
8 9 10 |
# File 'lib/gdkbox/shell.rb', line 8 def command @command end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/gdkbox/shell.rb', line 8 def status @status end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
8 9 10 |
# File 'lib/gdkbox/shell.rb', line 8 def stderr @stderr end |