improvement: Don't show Process.info in stacktraces.

This commit is contained in:
James Harton 2024-05-27 10:10:30 +12:00
parent 8fca091723
commit 5358d5ae4c
Signed by: james
GPG key ID: 90E82DAA13F624F4

View file

@ -68,7 +68,9 @@ defmodule Splode.Error do
if is_nil(opts[:stacktrace]) do
{:current_stacktrace, stacktrace} = Process.info(self(), :current_stacktrace)
Keyword.put(opts, :stacktrace, %Splode.Stacktrace{stacktrace: stacktrace})
Keyword.put(opts, :stacktrace, %Splode.Stacktrace{
stacktrace: Enum.drop(stacktrace, 1)
})
else
opts
end
@ -80,7 +82,9 @@ defmodule Splode.Error do
if is_nil(opts[:stacktrace]) do
{:current_stacktrace, stacktrace} = Process.info(self(), :current_stacktrace)
Keyword.put(opts, :stacktrace, %Splode.Stacktrace{stacktrace: stacktrace})
Keyword.put(opts, :stacktrace, %Splode.Stacktrace{
stacktrace: Enum.drop(stacktrace, 1)
})
else
opts
end