summaryrefslogtreecommitdiff
path: root/src/rebar3.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r--src/rebar3.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index ff0ab6a..d3ea15f 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -221,10 +221,10 @@ set_options(State, {Options, NonOptArgs}) ->
%%
log_level() ->
case os:getenv("QUIET") of
- false ->
+ Q when Q == false; Q == "" ->
DefaultLevel = rebar_log:default_level(),
case os:getenv("DEBUG") of
- false ->
+ D when D == false; D == "" ->
DefaultLevel;
_ ->
DefaultLevel + 3
@@ -272,20 +272,22 @@ handle_error({error, rebar_abort}) ->
handle_error({error, {Module, Reason}}) ->
case code:which(Module) of
non_existing ->
- ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace", []),
+ ?CRASHDUMP("~p: ~p~n~p~n~n", [Module, Reason, erlang:get_stacktrace()]),
+ ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to stacktrace or consult rebar3.crashdump", []),
?DEBUG("Uncaught error: ~p ~p", [Module, Reason]),
?INFO("When submitting a bug report, please include the output of `rebar3 report \"your command\"`", []);
_ ->
- ?ERROR(Module:format_error(Reason), [])
+ ?ERROR("~s", [Module:format_error(Reason)])
end,
erlang:halt(1);
handle_error({error, Error}) when is_list(Error) ->
- ?ERROR(Error, []),
+ ?ERROR("~s", [Error]),
erlang:halt(1);
handle_error(Error) ->
%% Nothing should percolate up from rebar_core;
%% Dump this error to console
- ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace", []),
+ ?CRASHDUMP("Error: ~p~n~p~n~n", [Error, erlang:get_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
[] -> ok;