diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-06-10 20:25:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-10 20:25:59 -0400 |
commit | 979bb18b279d54a59a1ed72a5965b12ec3ac311e (patch) | |
tree | 4174c64cc9fa47ba06a19874a5ad08c74766088c /src/rebar3.erl | |
parent | e6d64858c5b6f951d20975f150b45ebdc401da2e (diff) | |
parent | 5945251fc032465b1eb609fee16efa52a9854a5a (diff) |
Merge pull request #1080 from project-fifo/crashdump
Write rebar3.crashdump on errors
Diffstat (limited to 'src/rebar3.erl')
-rw-r--r-- | src/rebar3.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index a1e2975..82b4472 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -272,7 +272,8 @@ 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\"`", []); _ -> @@ -285,7 +286,8 @@ handle_error({error, Error}) when is_list(Error) -> 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; |