Skip to content

Commit

Permalink
fix(RunStepError): pass entire step struct instead of just name when …
Browse files Browse the repository at this point in the history
…raising.
  • Loading branch information
jimsynz committed Mar 20, 2024
1 parent ec9573b commit 7623442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/reactor/executor/step_runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7623442

Please sign in to comment.