diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-01-23 15:04:47 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-01-23 15:04:47 +0000 |
commit | ea1dc56a9f5de5bc5b0d7d87e52a9748c71d3d35 (patch) | |
tree | 314563eeb6bebf93a67502902fea0b3744f9a897 | |
parent | 13e3bd379e9fcc54567ca49076f4fa1ec3937460 (diff) | |
download | rabbitmq-server-ea1dc56a9f5de5bc5b0d7d87e52a9748c71d3d35.tar.gz |
Improve display of boot errors.
-rw-r--r-- | src/rabbit.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 9907ffac..89440189 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -442,8 +442,7 @@ run_boot_step({StepName, Attributes}) -> [try apply(M,F,A) catch - _:Reason -> boot_error("FAILED~nReason: ~p~nStacktrace: ~p~n", - [Reason, erlang:get_stacktrace()]) + _:Reason -> boot_step_error(Reason, erlang:get_stacktrace()) end || {M,F,A} <- MFAs], io:format("done~n"), ok @@ -502,8 +501,14 @@ sort_boot_steps(UnsortedSteps) -> end]) end. +boot_step_error(Reason, Stacktrace) -> + boot_error("Error description:~n ~p~n~n" + "Log file (may contain more information):~n ~s~n~n" + "Stack trace:~n ~p~n~n", + [Reason, log_location(sasl), Stacktrace]). + boot_error(Format, Args) -> - io:format("BOOT ERROR: " ++ Format, Args), + io:format("~n~nBOOT FAILED~n===========~n~n" ++ Format, Args), error_logger:error_msg(Format, Args), timer:sleep(1000), exit({?MODULE, failure_during_boot}). |