Move from System.stacktrace to __STACKTRACE__

This commit is contained in:
Shashwat Ganesh
2020-06-04 22:52:32 +05:30
parent 74532749a3
commit 8e8efd8def
2 changed files with 6 additions and 6 deletions

View File

@@ -38,14 +38,14 @@ defmodule Execute do
defp expand(:ok, _), do: :ok
defp expand(error, module) do
defp expand({:error, stacktrace, exception}, module) do
{file, line} =
System.stacktrace()
stacktrace
|> Enum.drop_while(&(!in_koan?(&1, module)))
|> List.first()
|> extract_file_and_line
%{error: error, file: file, line: line}
%{error: exception, file: file, line: line}
end
defp in_koan?({module, _, _, _}, koan), do: module == koan