summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit.erl33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 09b0494ce1..02a2a899ad 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -320,13 +320,11 @@ ensure_config() ->
case rabbit_config:validate_config_files() of
ok -> ok;
{error, {ErrFmt, ErrArgs}} ->
- log_boot_error_and_exit(check_config_file, ErrFmt, ErrArgs)
+ throw({error, {check_config_file, ErrFmt, ErrArgs}})
end,
case rabbit_config:prepare_and_use_config() of
{error, {generation_error, Error}} ->
- log_boot_error_and_exit(generate_config_file,
- "~nConfig file generation failed ~s",
- Error);
+ throw({error, {generate_config_file, Error}});
ok -> ok
end.
@@ -463,9 +461,8 @@ start_it(StartFun) ->
true -> ok;
false -> StartFun()
end
- catch
- Class:Reason ->
- boot_error(Class, Reason)
+ catch Class:Reason ->
+ boot_error(Class, Reason)
after
unlink(Marker),
Marker ! stop,
@@ -1018,11 +1015,23 @@ boot_error(_, {could_not_start, rabbit, {{timeout_waiting_for_tables, _}, _}}) -
log_boot_error_and_exit(
timeout_waiting_for_tables,
"~n" ++ Err ++ rabbit_nodes:diagnostics(Nodes), []);
-boot_error(Class, {error, {cannot_log_to_file, _, _}} = Reason) ->
- log_boot_error_and_exit(
- Reason,
- "~nError description:~s",
- [lager:pr_stacktrace(erlang:get_stacktrace(), {Class, Reason})]);
+boot_error(_, {error, {cannot_log_to_file, unknown, Reason}}) ->
+ log_boot_error_and_exit(could_not_initialise_logger,
+ "failed to initialised logger: ~p~n",
+ [Reason]);
+boot_error(_, {error, {cannot_log_to_file, LogFile,
+ {cannot_create_parent_dirs, _, Reason}}}) ->
+ log_boot_error_and_exit(could_not_initialise_logger,
+ "failed to create parent directory for log file at '~s', reason: ~p~n",
+ [LogFile, Reason]);
+boot_error(_, {error, {cannot_log_to_file, LogFile, Reason}}) ->
+ log_boot_error_and_exit(could_not_initialise_logger,
+ "failed to open log file at '~s', reason: ~p~n",
+ [LogFile, Reason]);
+boot_error(_, {error, {generate_config_file, Error}}) ->
+ log_boot_error_and_exit(generate_config_file,
+ "~nConfig file generation failed ~s~n",
+ [Error]);
boot_error(Class, Reason) ->
LogLocations = log_locations(),
log_boot_error_and_exit(