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 /src | |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd_config.erl | 10 |
1 files changed, 7 insertions, 3 deletions
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. |