diff options
| author | Matthias Radestock <matthias@lshift.net> | 2008-11-30 12:14:33 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2008-11-30 12:14:33 +0000 |
| commit | c6e5e53ff82638ea3b840beff1b8ac1050275c20 (patch) | |
| tree | 1cfff7e51d91e33ba2f7a7537409b23feab0db85 /src | |
| parent | 38b8409c19a5e28c02b4988f1d201637e9915196 (diff) | |
| download | rabbitmq-server-git-c6e5e53ff82638ea3b840beff1b8ac1050275c20.tar.gz | |
consistent display of errors in rabbit_multi
There is some duplication of code in rabbit_control here, but imho
it's too little to justify refactoring
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_multi.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rabbit_multi.erl b/src/rabbit_multi.erl index c6a7e9200d..66a560e6dc 100644 --- a/src/rabbit_multi.erl +++ b/src/rabbit_multi.erl @@ -46,18 +46,22 @@ start() -> io:format("done.~n"), init:stop(); {'EXIT', {function_clause, [{?MODULE, action, _} | _]}} -> - io:format("Invalid command ~p~n", [FullCommand]), + error("invalid command '~s'", + [lists:flatten( + rabbit_misc:intersperse(" ", FullCommand))]), usage(); timeout -> - io:format("timeout starting some nodes.~n"), + error("timeout starting some nodes.", []), halt(1); Other -> - io:format("~nrabbit_multi action ~p failed:~n~p~n", - [Command, Other]), + error("~p", [Other]), halt(2) end end. +error(Format, Args) -> + io:format("Error: " ++ Format ++"~n", Args). + parse_args([Command | Args]) -> {list_to_atom(Command), Args}. |
