Nebo15 / sage

A dependency-free tool to run distributed transactions in Elixir, inspired by Sagas pattern.
MIT License
912 stars 40 forks source link

"inspect" implementation assumes atom stage names #74

Closed peaceful-james closed 1 year ago

peaceful-james commented 1 year ago

I often use tuples for stage names, especially when performing sage transactions in a loop.

The inspect implementation raises an ArgumentError when stage name is a tuple.

Should be a simple fix. I'll open a PR next weekend if nobody else picks it up by then.

lib/sage/inspect.ex:22

  defp format_stage({name, operation}) do
    name = "#{Atom.to_string(name)}: "
    group(concat([name, nest(build_operation(operation), String.length(name))]))
  end
AndrewDryga commented 1 year ago

Great catch ❤️, closing in favor of PR! Thanks for it!