Permalink
Browse files

Slightly better error messages on failed startup

  • Loading branch information...
klacke committed Mar 19, 2013
1 parent bead34b commit 9acc88e6458039fdb61e981df9df619be347d678
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/yaws_config.erl
View
@@ -50,7 +50,7 @@ paths() ->
load(E = #env{conf = false}) ->
case yaws:first(fun(F) -> yaws:exists(F) end, paths()) of
false ->
- {error, "Can't find config file "};
+ {error, "Can't find any config file "};
{ok, _, File} ->
load(E#env{conf = {file, File}})
end;
@@ -79,8 +79,8 @@ load(E) ->
Err ->
Err
end;
- _ ->
- {error, "Can't open config file " ++ File}
+ Err ->
+ {error, ?F("Can't open config file ~s: ~p", [File, Err])}
end.
@@ -599,8 +599,9 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) ->
Err ->
Err
end;
- _ ->
- {error, "Can't open config file " ++ File}
+ Err ->
+ {error, ?F("Can't open config file ~s:~p",
+ [File,Err])}
end;
false ->
{error, ?F("Expect filename at line ~w", [Lno])}

0 comments on commit 9acc88e

Please sign in to comment.