diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2015-02-26 14:48:28 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2015-02-26 14:48:28 +0000 |
| commit | cfc289b72cfc2619b4694fe13fa100c64d328018 (patch) | |
| tree | 41b0cc4b2a49520cd58bcee5f2fca547f4f36a87 /src | |
| parent | b1cfedc71209a9fe91016b90107ac2e3639eab43 (diff) | |
| download | rabbitmq-server-git-cfc289b72cfc2619b4694fe13fa100c64d328018.tar.gz | |
Detangle boot error handling, step 1
We want to clean up basic_boot_error/3, but these call sites make it
harder. Really, trying to produce nicely formatted errors here is a
waste of time, these errors can only be caused when adding boot steps.
Normal users should never see them. So don't complicate things by
handling them specially.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 3bfd442898..7e35224669 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -580,29 +580,13 @@ sort_boot_steps(UnsortedSteps) -> {_App, StepName, Attributes} <- SortedSteps, {mfa, {M,F,A}} <- Attributes, not erlang:function_exported(M, F, length(A))] of - [] -> SortedSteps; - MissingFunctions -> basic_boot_error( - {missing_functions, MissingFunctions}, - "Boot step functions not exported: ~p~n", - [MissingFunctions]) + [] -> SortedSteps; + MissingFns -> exit({boot_functions_not_exported, MissingFns}) end; {error, {vertex, duplicate, StepName}} -> - basic_boot_error({duplicate_boot_step, StepName}, - "Duplicate boot step name: ~w~n", [StepName]); + exit({duplicate_boot_step, StepName}); {error, {edge, Reason, From, To}} -> - basic_boot_error( - {invalid_boot_step_dependency, From, To}, - "Could not add boot step dependency of ~w on ~w:~n~s", - [To, From, - case Reason of - {bad_vertex, V} -> - io_lib:format("Boot step not registered: ~w~n", [V]); - {bad_edge, [First | Rest]} -> - [io_lib:format("Cyclic dependency: ~w", [First]), - [io_lib:format(" depends on ~w", [Next]) || - Next <- Rest], - io_lib:format(" depends on ~w~n", [First])] - end]) + exit({invalid_boot_step_dependency, From, To, Reason}) end. -ifdef(use_specs). |
