Skip to content

Commit

Permalink
improvement: Don't show Process.info in stacktraces. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsynz authored May 26, 2024
1 parent 906a82e commit 8f97bd0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/splode/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8f97bd0

Please sign in to comment.