diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-10-13 08:58:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-13 08:58:52 -0400 |
commit | 65f66dae0fdb27de4fab289b5d7c60733d8598f5 (patch) | |
tree | 75706656ffe3e4c024765e6ab3832ba89cbf92f6 /src/rebar3.erl | |
parent | cc7141ba419e4f80b0e5da3d24b726679b473552 (diff) | |
parent | 294fd72f4d8f3beb2e856f085e634549d978b7fd (diff) |
Merge pull request #1351 from ElectronicRU/fix_stacktrace
Fix stacktrace printing in DEBUG=1 mode. Fixes #1347.
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r-- | src/rebar3.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index c665f20..47dc25a 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -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]) |