fix: Add stacktrace to exception#265
Conversation
When an exception occured inside of a Reactor.Step it would not show the stacktrace but only the error message. This change includes the stacktrace in the exception and also adds a test that validates this
You know I think just removing the rescue would work, as then the error would be correctly handled by the step runner rescue that you've modified. Do you want to include that in this change? |
Raised errors inside of a pipeline are indeed handled by the step_runner so that would not be an issue. But there is a test that explicitly checks if an AnonFn rescues errors: |
Meh. Just remove it :) |
This prevented the stacktrace from being passed down to the executor.
|
Alright removed the rescue statement in the AnonFn and also updated the tests to verify that the line numbers are correct |
|
🎉 thanks for the contribution! 🎉 |

When an exception occured inside of a Reactor.Step it would not show the stacktrace but only the error message. This change includes the stacktrace in the exception and also adds a test that validates this.
This only works for "named" steps. The easiest way to also make it work for anonymous steps would be to remove the rescue clause from the
AnonFn.run/3function:https://github.com/ash-project/reactor/blob/df74431bd1bc62a1c8935f86a65fc86abe13a9f4/lib/reactor/step/anon_fn.ex#L32C1-L33C29
Changing the
AnonFn.run/3would be a breaking change so I wanted to discuss that first.Contributor checklist
Leave anything that you believe does not apply unchecked.