diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2019-04-25 03:20:49 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2019-04-25 03:20:49 +0300 |
| commit | 009b0482ac8667b97c04012507a0568f1b7f9217 (patch) | |
| tree | 8196625fe83d8d8c6aa43407d618748760c42fc4 /src | |
| parent | 54bda9775c71de431f6b7626f95e500c8881c505 (diff) | |
| parent | db74cf2ad35bd055a5d40e353a1c450b6992b8a5 (diff) | |
| download | rabbitmq-server-git-009b0482ac8667b97c04012507a0568f1b7f9217.tar.gz | |
Merge branch 'velimir-schema-check-boot-failed'
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 33 |
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( |
