diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-16 17:22:32 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-16 17:22:32 +0100 |
commit | 5da4862faf958f1bfacc4b0a5f9326dac998afe0 (patch) | |
tree | 305b559192028531405e92a7a74620a36fb9d022 | |
parent | 1c53d4743ffacad14f2fb553f9f2344c0ae6579b (diff) | |
download | rabbitmq-server-5da4862faf958f1bfacc4b0a5f9326dac998afe0.tar.gz |
Fix formatted error handling as broken by Matthias in 891e659f0e77.
-rw-r--r-- | src/rabbit_control_main.erl | 10 | ||||
-rw-r--r-- | src/rabbit_tests.erl | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index e75e1f6f..a3cbf6e5 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -170,8 +170,8 @@ start() -> {error, Reason} -> print_error("~p", [Reason]), rabbit_misc:quit(2); - {parse_error, {_Line, Mod, Err}} -> - print_error("~s", [lists:flatten(Mod:format_error(Err))]), + {error_string, Reason} -> + print_error("~s", [Reason]), rabbit_misc:quit(2); {badrpc, {'EXIT', Reason}} -> print_error("~p", [Reason]), @@ -477,12 +477,14 @@ action(eval, Node, [Expr], _Opts, _Inform) -> Node, erl_eval, exprs, [Parsed, []]), io:format("~p~n", [Value]), ok; - {error, E} -> {parse_error, E} + {error, E} -> {error_string, format_parse_error(E)} end; {error, E, _} -> - {parse_error, E} + {error_string, format_parse_error(E)} end. +format_parse_error({_Line, Mod, Err}) -> lists:flatten(Mod:format_error(Err)). + %%---------------------------------------------------------------------------- wait_for_application(Node, PidFile, Application, Inform) -> diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index 2e26837d..aa48f228 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -1100,8 +1100,8 @@ test_server_status() -> ok = control_action(set_vm_memory_high_watermark, [float_to_list(HWM)]), %% eval - {parse_error, _} = control_action(eval, ["\""]), - {parse_error, _} = control_action(eval, ["a("]), + {error_string, _} = control_action(eval, ["\""]), + {error_string, _} = control_action(eval, ["a("]), ok = control_action(eval, ["a."]), %% cleanup |