diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-12-21 22:26:22 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-12-21 22:26:22 +0000 |
commit | 26f027fc5201c3288f7c112a965f6a515be281cf (patch) | |
tree | 9b8d6a996dfa2c9d13ed84f65157b75e3baa7c46 /prosody | |
parent | 519b72e6e989a18ede51fddddfa87f20a32ea29e (diff) | |
download | prosody-26f027fc5201c3288f7c112a965f6a515be281cf.tar.gz prosody-26f027fc5201c3288f7c112a965f6a515be281cf.zip |
prosody: Catch a recursive Include error and print a more friendly error
Diffstat (limited to 'prosody')
-rwxr-xr-x | prosody | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -77,9 +77,15 @@ function read_config() print("\n"); print("**************************"); if level == "parser" then - print("A problem occured while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); + print("A problem occured while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"..":"); + print(""); local err_line, err_message = tostring(err):match("%[string .-%]:(%d*): (.*)"); - print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); + if err:match("chunk has too many syntax levels$") then + print("An Include statement in a config file is including an already-included"); + print("file and causing an infinite loop. An Include statement in a config file is..."); + else + print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); + end print(""); elseif level == "file" then print("Prosody was unable to find the configuration file."); |