Stacktrace arity can be an argument list in some cases

According to [1]. What even are types.

1. https://erlang.org/doc/reference_manual/errors.html
This commit is contained in:
Michael Klishin 2021-03-22 21:08:31 +03:00
parent 1587e080b9
commit 246f50598b
No known key found for this signature in database
GPG Key ID: E80EDCFA0CDB21EE
1 changed files with 5 additions and 2 deletions

View File

@ -101,10 +101,10 @@ format_exception(Class, Exception, Stacktrace) ->
StacktraceStrs = [case proplists:get_value(line, Props) of
undefined ->
io_lib:format(" ~ts:~ts/~b",
[Mod, Fun, Arity]);
[Mod, Fun, format_arity(Arity)]);
Line ->
io_lib:format(" ~ts:~ts/~b, line ~b",
[Mod, Fun, Arity, Line])
[Mod, Fun, format_arity(Arity), Line])
end
|| {Mod, Fun, Arity, Props} <- Stacktrace],
ExceptionStr = io_lib:format("~ts:~0p", [Class, Exception]),
@ -128,3 +128,6 @@ log_message(Message) ->
end, Lines),
timer:sleep(1000),
ok.
format_arity(N) when is_integer(N) -> N;
format_arity(Args) when is_list(Args) -> length(Args).