diff options
author | Badlop <badlop@process-one.net> | 2008-07-22 16:08:57 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2008-07-22 16:08:57 +0000 |
commit | 543fb2d7e48d279507ed95285dcdd10c29630492 (patch) | |
tree | 8b605ced6aa58651e3b5b9c45b21440f7ffb53df | |
parent | * src/odbc/odbc_queries.erl: Fixed a typo (diff) |
* src/ejabberd_config.erl: If syntax mistake in config file, show
specific error message (EJAB-616)
SVN Revision: 1470
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/ejabberd_config.erl | 10 |
2 files changed, 12 insertions, 3 deletions
@@ -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-22 Alexey Shchepin <alexey@process-one.net> * src/odbc/odbc_queries.erl: Fixed a typo diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index c18cfe6d..1cd9c671 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -95,10 +95,14 @@ get_plain_terms_file(File1) -> 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. |