Skip to content

Commit 2d1830a

Browse files
authored
Merge pull request #443 from rlchu/repair-metadata-reporter-erlang-wrapped-error-reason
adjust metadata_reporter :transaction report_error
2 parents 56525d9 + 3834a36 commit 2d1830a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/new_relic/error/metadata_reporter.ex

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ defmodule NewRelic.Error.MetadataReporter do
1111

1212
def report_error(:transaction, {_cause, metadata}) do
1313
kind = :error
14-
{_exception_type, reason, stacktrace, _expected} = parse_reason(metadata.reason)
14+
{exception, stacktrace} = metadata.reason
1515
process_name = parse_process_name(metadata[:registered_name], stacktrace)
1616

1717
NewRelic.add_attributes(process: process_name)
1818

1919
NewRelic.Transaction.Reporter.error(%{
2020
kind: kind,
21-
reason: reason,
21+
reason: exception,
2222
stack: stacktrace
2323
})
2424
end
@@ -81,6 +81,7 @@ defmodule NewRelic.Error.MetadataReporter do
8181

8282
defp parse_process_name([], [{module, _f, _a, _} | _]), do: inspect(module)
8383
defp parse_process_name([], _stacktrace), do: "UnknownProcess"
84+
defp parse_process_name(nil, _stacktrace), do: "UnknownProcess"
8485
defp parse_process_name(registered_name, _stacktrace), do: inspect(registered_name)
8586

8687
defp parse_error_expected(%{expected: true}), do: true

0 commit comments

Comments
 (0)