Skip to content

Commit

Permalink
adding another exit pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
devonestes committed Dec 18, 2020
1 parent 4f66a78 commit 7633d95
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/rollbax/reporter/standard.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ defmodule Rollbax.Reporter.Standard do

{_, info, stacktrace} when is_tuple(info) ->
case elem(info, 0) do
%class{message: message} -> {inspect(class), message, stacktrace, ""}
%class{} -> {inspect(class), inspect(class), stacktrace, ""}
atom when is_atom(atom) -> {inspect(atom), inspect(atom), stacktrace, ""}
{%class{message: message}, inner_stacktrace} -> {inspect(class), message, inner_stacktrace, ""}
{%class{}, inner_stacktrace} -> {inspect(class), inspect(class), inner_stacktrace, ""}
{atom, inner_stacktrace} when is_atom(atom) -> {inspect(atom), inspect(atom), inner_stacktrace, ""}
%class{message: message} -> {inspect(class), message, stacktrace, inspect(info)}
%class{} -> {inspect(class), inspect(class), stacktrace, inspect(info)}
atom when is_atom(atom) -> {inspect(atom), inspect(atom), stacktrace, inspect(info)}
{%class{message: message}, inner_stacktrace} -> {inspect(class), message, inner_stacktrace, inspect(info)}
{%class{}, inner_stacktrace} -> {inspect(class), inspect(class), inner_stacktrace, inspect(info)}
{atom, inner_stacktrace} when is_atom(atom) -> {inspect(atom), inspect(atom), inner_stacktrace, inspect(info)}
{{%class{message: message}, inner_stacktrace}, _} -> {inspect(class), message, inner_stacktrace, inspect(info)}
reason -> {"ProcessCrash", "A process crashed", stacktrace, inspect(reason, limit: :infinity)}
end
end
Expand Down

0 comments on commit 7633d95

Please sign in to comment.