* src/ejabberd_config.erl: If syntax mistake in config file, show

specific error message (EJAB-616)

SVN Revision: 1470
This commit is contained in:
Badlop 2008-07-22 16:08:57 +00:00
parent 4ebaf3efa0
commit 293676d2a6
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2008-07-22 Badlop <badlop@process-one.net>
* src/ejabberd_config.erl: If syntax mistake in config file, show
specific error message (EJAB-616)
2008-07-17 Badlop <badlop@process-one.net>
* src/mod_muc/mod_muc_room.erl: Fix to allow a server admin to add

View File

@ -64,10 +64,14 @@ load_file(File) ->
State = lists:foldl(fun search_hosts/2, #state{}, Terms),
Res = lists:foldl(fun process_term/2, State, Terms),
set_opts(Res);
{error, Reason} ->
ExitText = lists:flatten(File ++ ": around line "
{error, {_LineNumber, erl_parse, _ParseMessage} = Reason} ->
ExitText = lists:flatten(File ++ " approximately in the line "
++ file:format_error(Reason)),
?ERROR_MSG("Problem loading ejabberd config file:~n~s", [ExitText]),
?ERROR_MSG("Problem loading ejabberd config file ~n~s", [ExitText]),
exit(ExitText);
{error, Reason} ->
ExitText = lists:flatten(File ++ ": " ++ file:format_error(Reason)),
?ERROR_MSG("Problem loading ejabberd config file ~n~s", [ExitText]),
exit(ExitText)
end.