Exception: Bosh::Exec::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Bosh::Exec::Error
- Defined in:
- lib/common/exec/error.rb
Overview
Raised when there was an error executing the command
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(status, command, output = nil) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(status, command, output = nil) ⇒ Error
Returns a new instance of Error.
8 9 10 11 12 |
# File 'lib/common/exec/error.rb', line 8 def initialize(status, command, output=nil) @status = status @command = command @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
6 7 8 |
# File 'lib/common/exec/error.rb', line 6 def output @output end |
Instance Method Details
#message ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/common/exec/error.rb', line 14 def if @status "command '#{@command}' failed with exit code #{@status}" else "command not found: #{@command}" end end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/common/exec/error.rb', line 22 def to_s end |