Exception: Open4::SpawnError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, status) ⇒ SpawnError

Returns a new instance of SpawnError.



90
91
92
93
94
95
96
97
98
99
# File 'lib/open4.rb', line 90

def initialize cmd, status
  @cmd, @status = cmd, status
  @signals = {} 
  if status.signaled?
    @signals['termsig'] = status.termsig
    @signals['stopsig'] = status.stopsig
  end
  sigs = @signals.map{|k,v| "#{ k }:#{ v.inspect }"}.join(' ')
  super "cmd <#{ cmd }> failed with status <#{ exitstatus.inspect }> signals <#{ sigs }>"
end

Instance Attribute Details

#cmdObject (readonly)

–{{{



84
85
86
# File 'lib/open4.rb', line 84

def cmd
  @cmd
end

#signalsObject (readonly)

Returns the value of attribute signals.



86
87
88
# File 'lib/open4.rb', line 86

def signals
  @signals
end

#statusObject (readonly)

Returns the value of attribute status.



85
86
87
# File 'lib/open4.rb', line 85

def status
  @status
end

Instance Method Details

#exitstatusObject



87
88
89
# File 'lib/open4.rb', line 87

def exitstatus
  @status.exitstatus
end