@@ -98,6 +98,9 @@ start() ->
9898 {error , Reason } ->
9999 print_error (" ~p " , [Reason ]),
100100 rabbit_misc :quit (2 );
101+ {error_string , Reason } ->
102+ print_error (" ~s " , [Reason ]),
103+ rabbit_misc :quit (2 );
101104 {badrpc , {'EXIT' , Reason }} ->
102105 print_error (" ~p " , [Reason ]),
103106 rabbit_misc :quit (2 );
@@ -379,11 +382,11 @@ action(eval, Node, [Expr], _Opts, _Inform) ->
379382 Node , erl_eval , exprs , [Parsed , []]),
380383 io :format (" ~p~n " , [Value ]),
381384 ok ;
382- {error , { 1 , erl_parse , Err } } ->
383- {error , Err }
385+ {error , E } ->
386+ {error_string , format_parse_error ( E ) }
384387 end ;
385- {error , { 1 , erl_scan , E } , _ } ->
386- {error , [ " scan error: " , E ] }
388+ {error , E , _ } ->
389+ {error_string , format_parse_error ( E ) }
387390 end .
388391
389392% %----------------------------------------------------------------------------
@@ -459,6 +462,9 @@ system(Cmd) ->
459462escape_quotes (Cmd ) ->
460463 lists :flatten (lists :map (fun ($' ) -> " '\\ ''" ; (Ch ) -> Ch end , Cmd )).
461464
465+ format_parse_error ({_Line , Mod , Err }) ->
466+ lists :flatten (Mod :format_error (Err )).
467+
462468% %----------------------------------------------------------------------------
463469
464470default_if_empty (List , Default ) when is_list (List ) ->
0 commit comments