Permalink
Browse files

* src/yaws_ctl.erl: Process the case when ctlfile is parseable but its

  content is invalid.
  • Loading branch information...
1 parent c6772e2 commit 421623c5d7632705e1b1c84082b033b9a2ac94a3 @sgolovan committed Jan 16, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/yaws_ctl.erl
View
9 src/yaws_ctl.erl
@@ -397,6 +397,8 @@ connect_file(CtlFile) ->
Err ->
Err
end;
+ {ok, Terms} ->
+ {error, {content, Terms}};
Err ->
Err
end.
@@ -417,6 +419,13 @@ actl(SID, Term) ->
io:format("No yaws system responds~n",[]),
timer:sleep(10),
erlang:halt(2);
+ {error, {content,Terms}} ->
+ io:format("The ctlfile ~s is readable but its content~n"
+ "~p~n"
+ "isn't in YAWS control file format~n",
+ [yaws:ctl_file(SID),Terms]),
+ timer:sleep(10),
+ erlang:halt(2);
{error, Reason} ->
io:format("You failed to read the ctlfile ~s~n"
"error was: <~p>~n"

0 comments on commit 421623c

Please sign in to comment.