소스 검색

Get stacktrace only once and as soon as possible. Fixes #1347.

It turns out that pretty-printing uses throw-catch and thus garbages out
the stack trace sometimes, so we should get it only once.
pull/1351/head
Alexander Sedov 8 년 전
부모
커밋
294fd72f4d
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. +3
    -2
      src/rebar3.erl

+ 3
- 2
src/rebar3.erl 파일 보기

@ -286,10 +286,11 @@ handle_error({error, Error}) when is_list(Error) ->
handle_error(Error) -> handle_error(Error) ->
%% Nothing should percolate up from rebar_core; %% Nothing should percolate up from rebar_core;
%% Dump this error to console %% 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", []), ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump", []),
?DEBUG("Uncaught error: ~p", [Error]), ?DEBUG("Uncaught error: ~p", [Error]),
case erlang:get_stacktrace() of
case StackTrace of
[] -> ok; [] -> ok;
Trace -> Trace ->
?DEBUG("Stack trace to the error location:~n~p", [Trace]) ?DEBUG("Stack trace to the error location:~n~p", [Trace])

불러오는 중...
취소
저장