+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-22 Alexey Shchepin <alexey@process-one.net>
* src/odbc/odbc_queries.erl: Fixed a typo
case file:consult(File) of
{ok, Terms} ->
include_config_files(Terms);
- {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.