Exception: Sunshine::CmdError

Inherits:
Exception
  • Object
show all
Defined in:
lib/sunshine/exceptions.rb

Overview

An error occurred when attempting to run a command on the local system

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_code, cmd = nil) ⇒ CmdError

Returns a new instance of CmdError.



23
24
25
26
27
# File 'lib/sunshine/exceptions.rb', line 23

def initialize exit_code, cmd=nil
  message = "Execution failed with status #{exit_code}: #{cmd}"
  super message
  @exit_code = exit_code
end

Instance Attribute Details

#exit_codeObject (readonly)

Returns the value of attribute exit_code.



21
22
23
# File 'lib/sunshine/exceptions.rb', line 21

def exit_code
  @exit_code
end