# HG changeset patch # User Kim Alvefur # Date 1506519209 -7200 # Node ID 5ebad58b2548b1ba77c0f40fd61d7d4277eb229e # Parent 13dad833e821b668a42951db77095d898a775366 prosody, prosodyctl: Print the actual config file name used when a problem loading it was encountered (see #990) diff -r 13dad833e821 -r 5ebad58b2548 prosody --- a/prosody Wed Sep 27 15:27:29 2017 +0200 +++ b/prosody Wed Sep 27 15:33:29 2017 +0200 @@ -95,7 +95,7 @@ print("\n"); print("**************************"); if level == "parser" then - print("A problem occurred while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"..":"); + print("A problem occured while reading the config file "..filename); print(""); local err_line, err_message = tostring(err):match("%[string .-%]:(%d*): (.*)"); if err:match("chunk has too many syntax levels$") then @@ -107,7 +107,7 @@ print(""); elseif level == "file" then print("Prosody was unable to find the configuration file."); - print("We looked for: "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); + print("We looked for: "..filename); print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist"); print("Copy or rename it to prosody.cfg.lua and edit as necessary."); end diff -r 13dad833e821 -r 5ebad58b2548 prosodyctl --- a/prosodyctl Wed Sep 27 15:27:29 2017 +0200 +++ b/prosodyctl Wed Sep 27 15:33:29 2017 +0200 @@ -93,13 +93,13 @@ 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 "..filename); 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))); print(""); elseif level == "file" then print("Prosody was unable to find the configuration file."); - print("We looked for: "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); + print("We looked for: "..filename); print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist"); print("Copy or rename it to prosody.cfg.lua and edit as necessary."); end