Skip to content

Commit

Permalink
Merge pull request #1351 from ElectronicRU/fix_stacktrace
Browse files Browse the repository at this point in the history
Fix stacktrace printing in DEBUG=1 mode. Fixes #1347.
  • Loading branch information
ferd authored Oct 13, 2016
2 parents cc7141b + 294fd72 commit 65f66da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rebar3.erl
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,11 @@ handle_error({error, Error}) when is_list(Error) ->
handle_error(Error) ->
%% Nothing should percolate up from rebar_core;
%% Dump this error to console
?CRASHDUMP("Error: ~p~n~p~n~n", [Error, erlang:get_stacktrace()]),
StackTrace = erlang:get_stacktrace(),
?CRASHDUMP("Error: ~p~n~p~n~n", [Error, StackTrace]),
?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump", []),
?DEBUG("Uncaught error: ~p", [Error]),
case erlang:get_stacktrace() of
case StackTrace of
[] -> ok;
Trace ->
?DEBUG("Stack trace to the error location:~n~p", [Trace])
Expand Down

0 comments on commit 65f66da

Please sign in to comment.