Exception: Flor::Caller::SpawnNonZeroExitError

Inherits:
SpawnError
  • Object
show all
Defined in:
lib/flor/unit/caller.rb

Instance Attribute Summary collapse

Attributes inherited from SpawnError

#conf, #ctx

Instance Method Summary collapse

Methods inherited from SpawnError

#details

Constructor Details

#initialize(conf, ctx, status, stdout, stderr) ⇒ SpawnNonZeroExitError

Returns a new instance of SpawnNonZeroExitError.



302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/flor/unit/caller.rb', line 302

def initialize(conf, ctx, status, stdout, stderr)

  @status = s = status
  @stdout = stdout.read
  @stderr = stderr.read

  ctx[:pid] ||= status.pid

  msg = @stderr.strip.split("\n").last

  super(conf, ctx, "(code: #{s.exitstatus}, pid: #{s.pid}) #{msg}")
end

Instance Attribute Details

#errObject (readonly)

Returns the value of attribute err.



300
301
302
# File 'lib/flor/unit/caller.rb', line 300

def err
  @err
end

#outObject (readonly)

Returns the value of attribute out.



300
301
302
# File 'lib/flor/unit/caller.rb', line 300

def out
  @out
end

#statusObject (readonly)

Returns the value of attribute status.



300
301
302
# File 'lib/flor/unit/caller.rb', line 300

def status
  @status
end

Instance Method Details

#add_details(details) ⇒ Object



315
316
317
318
319
320
# File 'lib/flor/unit/caller.rb', line 315

def add_details(details)

  details[:status] = status.to_s
  details[:stdout] = @stdout
  details[:stderr] = @stderr
end