Skip to content

Commit

Permalink
Merge pull request #9 from rabbitmq/support-args-in-stacktraces
Browse files Browse the repository at this point in the history
Support argument lists in stacktraces
  • Loading branch information
dumbbell authored Mar 30, 2023
2 parents d91d8d5 + 53e951d commit 47add10
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/horus.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,17 @@ reconstruct_original_stracktrace(
Stacktrace) ->
lists:map(
fun
({Module, Name, Args, Extra})
when GeneratedModuleName =:= Module andalso is_list(Args) ->
Arity = length(Args),
{RealModule, RealName, RealArity} =
maps:get({Name, Arity}, FunNameMapping),

RealArgs = lists:sublist(Args, RealArity),
?assertEqual(RealArity, length(RealArgs)),
{RealModule, RealName, RealArgs, Extra};
({Module, Name, Arity, Extra})
when GeneratedModuleName =:= Module ->
when GeneratedModuleName =:= Module andalso is_integer(Arity) ->
{RealModule, RealName, RealArity} =
maps:get({Name, Arity}, FunNameMapping),

Expand Down

0 comments on commit 47add10

Please sign in to comment.