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 | 32d4e29a4631352876b5397118f5887bf9359e3a (patch) | |
tree | 1cfff7e51d91e33ba2f7a7537409b23feab0db85 /src/rabbit_multi.erl | |
parent | 5e7a2dc8b24c7413645b58891d761afdab356023 (diff) | |
download | rabbitmq-server-32d4e29a4631352876b5397118f5887bf9359e3a.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/rabbit_multi.erl')
-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 c6a7e920..66a560e6 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}. |