class Flor::Caller::SpawnError

Attributes

conf[RW]
ctx[RW]

Public Class Methods

new(conf, ctx, msg) click to toggle source
Calls superclass method
# File lib/flor/unit/caller.rb, line 244
def initialize(conf, ctx, msg)

  @conf = conf
  @ctx = ctx

  super(msg)
end

Public Instance Methods

details() click to toggle source
# File lib/flor/unit/caller.rb, line 252
def details

  ha = Flor.yes?(@conf['on_error_hide_all'])
  hcd = Flor.yes?(@conf['on_error_hide_cmd'])
  hcf = Flor.yes?(@conf['on_error_hide_conf'])

  cd = (ha || hcd) ? '(hidden)' : @conf['cmd']
  cf = (ha || hcf) ? '(hidden)' : @conf.dup
  cf['cmd'] = '(hidden)' if hcd && cf.is_a?(Hash)

  d = {
    cmd: cd, conf: cf,
    timeout: ctx[:to],
    pid: ctx[:pid],
    start: Flor.tstamp(ctx[:t0]),
    duration: Fugit.parse(Time.now - ctx[:t0]).to_plain_s,
    cause: cause }

  add_details(d) \
    if respond_to?(:add_details)

  d
end