Skip to content

Commit

Permalink
Prett print of error message when stdin is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
hawk committed Jun 7, 2012
1 parent 23f1678 commit 53ba69b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lux_debug.erl
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ loop(I, Ipid, PrevCmd, CmdState, N) ->
%% Closed already at startup
exit(normal);
eof ->
catch erlang:display("\nEOF: stdin closed\n"),
catch io:format("\nEOF: stdin closed\n", []),
exit(normal);
{error, Reason} ->
ReasonStr = file:format_error(Reason),
catch erlang:display("\nERROR: " ++ ReasonStr ++ "\n"),
catch io:format("\nERROR: ~s\n", [ReasonStr]),
exit(Reason);
Cmd0 ->
[$\n | Rest] = lists:reverse(Cmd0),
Expand Down

0 comments on commit 53ba69b

Please sign in to comment.