]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_config.erl: If syntax mistake in config file, show
authorBadlop <badlop@process-one.net>
Tue, 22 Jul 2008 16:08:57 +0000 (16:08 +0000)
committerBadlop <badlop@process-one.net>
Tue, 22 Jul 2008 16:08:57 +0000 (16:08 +0000)
specific error message (EJAB-616)

SVN Revision: 1470

ChangeLog
src/ejabberd_config.erl

index 2fe69f5dcf42f0415eba7a05d26f2a7e1a87c4da..23449e7686e019467823434f89ccb04243224d27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index cce7b814637067cf1e6166923f6ceb3bb20e037e..1f47eec334e030ea2968cea331a25320e032f3a2 100644 (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.