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 | bbd45f3d83621c78df930ab03864de04f65daacf (patch) | |
| tree | 305b559192028531405e92a7a74620a36fb9d022 | |
| parent | 78690e72efb16c5d777af3fab4f16048d2d1a34d (diff) | |
| download | rabbitmq-server-git-bbd45f3d83621c78df930ab03864de04f65daacf.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 e75e1f6f7c..a3cbf6e53c 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 2e26837df0..aa48f22833 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 |
