Skip to content

Commit

Permalink
Do not use deprecated erlang:get_stacktrace()
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxofil committed Oct 23, 2019
1 parent 5976afd commit 1762bd6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/echessd_httpd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ process(ModData, Query, Session) ->
ModData, Session,
generate_html(ModData#mod.method, Query, Session))
catch
Type:Reason ->
Type:Reason:StackTrace ->
ErrMsg = geterr(Session, txt_resp_send_error,
{Type, Reason, erlang:get_stacktrace()}),
{Type, Reason, StackTrace}),
{break, [{response, {501, ErrMsg}}]}
end.

Expand All @@ -128,8 +128,8 @@ generate_html(Method, Query, Session) ->
catch
_:{error, Reason} ->
geterr(Session, txt_resp_gen_error, Reason);
Type:Reason ->
FinalReason = {Type, Reason, erlang:get_stacktrace()},
Type:Reason:StackTrace ->
FinalReason = {Type, Reason, StackTrace},
geterr(Session, txt_resp_gen_error, FinalReason)
end.

Expand Down
5 changes: 2 additions & 3 deletions src/echessd_mime_types.erl
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ read_mime_types(Filename) ->
Result =
try read_mime_types_loop(FH, [])
catch
Type:Reason ->
Type:Reason:StackTrace ->
{error,
{Type, Reason,
erlang:get_stacktrace()}}
{Type, Reason, StackTrace}}
end,
catch file:close(FH),
Result;
Expand Down
4 changes: 2 additions & 2 deletions src/echessd_notify.erl
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ do_notify_(MessageGenerator, Username) ->
JabberID, Message,
XmppUser, XmppServer, XmppPassword)
catch
Type:Reason ->
Type:Reason:StackTrace ->
echessd_log:err(
"~w: failed to format notification: ~9999p",
[?MODULE,
{Type, Reason, erlang:get_stacktrace()}])
{Type, Reason, StackTrace}])
end;
_ -> ok
end;
Expand Down
4 changes: 2 additions & 2 deletions src/echessd_user.erl
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ check_properties(Term) ->
catch
_:{error, _} = Error ->
Error;
Type:Reason ->
{error, {Type, Reason, erlang:get_stacktrace()}}
Type:Reason:StackTrace ->
{error, {Type, Reason, StackTrace}}
end.

%% @doc
Expand Down

0 comments on commit 1762bd6

Please sign in to comment.