Module: Kobako::CarriesExecution

Included in:
SandboxError, ServiceError, TrapError
Defined in:
lib/kobako/errors.rb,
sig/kobako/errors.rbs

Overview

Carries the frozen Kobako::Execution of the run that failed, so a rescue reads its captures and usage exactly as a successful caller reads them off the return value. Mixed only into the three invocation-outcome classes (+TrapError+ / SandboxError / ServiceError and their subclasses); SetupError and PoolTimeoutError arise outside any invocation and carry no Execution. Defaults to nil — a pre-flight failure that ran no invocation leaves it unset.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#executionKobako::Execution? (readonly)

Returns the value of attribute execution.

Returns:



27
28
29
# File 'lib/kobako/errors.rb', line 27

def execution
  @execution
end

Instance Method Details

#with_execution(execution) ⇒ self

Attach the failed run's Kobako::Execution and return self so the raise site reads raise error.with_execution(execution).

Parameters:

Returns:

  • (self)


31
32
33
34
# File 'lib/kobako/errors.rb', line 31

def with_execution(execution)
  @execution = execution
  self
end