From 76234423eadd358e56ea4212e1ac4bc923a66622 Mon Sep 17 00:00:00 2001 From: James Harton Date: Thu, 21 Mar 2024 10:42:18 +1300 Subject: [PATCH] fix(RunStepError): pass entire step struct instead of just name when raising. --- lib/reactor/executor/step_runner.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reactor/executor/step_runner.ex b/lib/reactor/executor/step_runner.ex index aaaeb65..e0b32bd 100644 --- a/lib/reactor/executor/step_runner.ex +++ b/lib/reactor/executor/step_runner.ex @@ -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)