Consider the following snippet:
do_stuff() ->
% assume each of BoundVarI is bound here
BoundVar1 = term1(),
BoundVar2 = term2(),
% ...
BoundVarN = termN(),
ok.
do_stuff_wrapper() ->
do_stuff().
In the wrapper function (do_stuff_wrapper/0
), how exactly do I determine which one of the matches has failed? Just to be clear, I'm not looking for a way to tell that it has just failed, possibly by spawning and monitoring a process, but a way to tell which of the matches has caused to fail. One way I considered would be to just extract the line number from the error tuple, but I feel like that hurts maintainability a lot.