aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-21 22:26:22 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-21 22:26:22 +0000
commit18972368fe1a471b367b528058e399dfaf42e377 (patch)
tree390540340e67670caf3ce9eb46c37b8f7c7c4786
parent949fdfb956690ce0c4a2817a0f410db0bb751e88 (diff)
downloadprosody-18972368fe1a471b367b528058e399dfaf42e377.tar.gz
prosody-18972368fe1a471b367b528058e399dfaf42e377.zip
prosody: Catch a recursive Include error and print a more friendly error
-rwxr-xr-xprosody10
1 files changed, 8 insertions, 2 deletions
diff --git a/prosody b/prosody
index d4bf7578..07ec2bdb 100755
--- a/prosody
+++ b/prosody
@@ -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.");