diff options
author | Badlop <badlop@process-one.net> | 2008-10-24 22:16:17 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2008-10-24 22:16:17 +0000 |
commit | ff6891cdd087ee65e3fd9c8b8ca15ecb50ff1794 (patch) | |
tree | 02d30fedfd6bd3d7c53304b4257c0dd2ad68aa04 | |
parent | * src/ejabberd_ctl.erl: If ejabberd didn't start correctly: (diff) |
* src/translate.erl: When a translation file can't be loaded, show
detailed error message
SVN Revision: 1669
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/translate.erl | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2008-10-25 Badlop <badlop@process-one.net> + * src/translate.erl: When a translation file can't be loaded, show + detailed error message + * src/ejabberd_ctl.erl: If ejabberd didn't start correctly: 'ejabberdctl status' suggests to look in log files; any other ejabberdctl command shows 'status'. diff --git a/src/translate.erl b/src/translate.erl index eddea35e..0a7d6029 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -89,8 +89,16 @@ load_file(Lang, File) -> ets:insert(translations, {{Lang, Orig}, Trans1}) end, Terms); + %% Code copied from ejabberd_config.erl + {error, {_LineNumber, erl_parse, _ParseMessage} = Reason} -> + ExitText = lists:flatten(File ++ " approximately in the line " + ++ file:format_error(Reason)), + ?ERROR_MSG("Problem loading translation file ~n~s", [ExitText]), + exit(ExitText); {error, Reason} -> - exit(file:format_error(Reason)) + ExitText = lists:flatten(File ++ ": " ++ file:format_error(Reason)), + ?ERROR_MSG("Problem loading translation file ~n~s", [ExitText]), + exit(ExitText) end. translate(Lang, Msg) -> |