fix(RunStepError): pass entire step struct instead of just name when raising.

This commit is contained in:
James Harton 2024-03-21 10:42:18 +13:00
parent ec9573b2fe
commit 76234423ea
Signed by: james
GPG key ID: 90E82DAA13F624F4

View file

@ -117,7 +117,7 @@ defmodule Reactor.Executor.StepRunner do
|> handle_run_result(reactor, step, arguments, context)
rescue
reason ->
error = RunStepError.exception(step: step.name, error: reason)
error = RunStepError.exception(step: step, error: reason)
Hooks.event(reactor, {:run_error, error}, step, context)
maybe_compensate(reactor, step, error, arguments, context)
@ -149,7 +149,7 @@ defmodule Reactor.Executor.StepRunner do
end
defp handle_run_result({:error, reason}, reactor, step, arguments, context) do
error = RunStepError.exception(step: step.name, error: reason)
error = RunStepError.exception(step: step, error: reason)
Hooks.event(reactor, {:run_error, error}, step, context)
maybe_compensate(reactor, step, error, arguments, context)