Skip to content

Commit

Permalink
include MFA in frame
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Jun 11, 2024
1 parent 3920896 commit 14ae66b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/tower_rollbar/rollbar/item.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ defmodule TowerRollbar.Rollbar.Item do

defp frames(stacktrace) do
stacktrace
|> Enum.map(fn {_m, _f, _a, location} ->
frame = %{}
|> Enum.map(fn {m, f, a, location} ->
frame = %{
"method" => Exception.format_mfa(m, f, a)
}

frame =
if location[:file] do
Expand Down
4 changes: 4 additions & 0 deletions test/tower_rollbar/rollbar/item_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ defmodule TowerRollbar.Rollbar.ItemTest do
"trace" => %{
"frames" => [
%{
"method" => _,
"filename" => "lib/ex_unit/runner.ex",
"lineno" => _
},
%{
"method" => _,
"filename" => "timer.erl",
"lineno" => _
},
%{
"method" => _,
"filename" => "lib/ex_unit/runner.ex",
"lineno" => _
},
%{
"method" => ~s(TowerRollbar.Rollbar.ItemTest."test from_exception"/1),
"filename" => "test/tower_rollbar/rollbar/item_test.exs",
"lineno" => 12
}
Expand Down

0 comments on commit 14ae66b

Please sign in to comment.