Software /
code /
prosody
Comparison
prosodyctl @ 8276:5ebad58b2548
prosody, prosodyctl: Print the actual config file name used when a problem loading it was encountered (see #990)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 27 Sep 2017 15:33:29 +0200 |
parent | 8274:3798955049e3 |
child | 8277:57c5dd08ff0a |
comparison
equal
deleted
inserted
replaced
8275:13dad833e821 | 8276:5ebad58b2548 |
---|---|
91 local ok, level, err = config.load(filename); | 91 local ok, level, err = config.load(filename); |
92 if not ok then | 92 if not ok then |
93 print("\n"); | 93 print("\n"); |
94 print("**************************"); | 94 print("**************************"); |
95 if level == "parser" then | 95 if level == "parser" then |
96 print("A problem occured while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); | 96 print("A problem occured while reading the config file "..filename); |
97 local err_line, err_message = tostring(err):match("%[string .-%]:(%d*): (.*)"); | 97 local err_line, err_message = tostring(err):match("%[string .-%]:(%d*): (.*)"); |
98 print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); | 98 print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); |
99 print(""); | 99 print(""); |
100 elseif level == "file" then | 100 elseif level == "file" then |
101 print("Prosody was unable to find the configuration file."); | 101 print("Prosody was unable to find the configuration file."); |
102 print("We looked for: "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); | 102 print("We looked for: "..filename); |
103 print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist"); | 103 print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist"); |
104 print("Copy or rename it to prosody.cfg.lua and edit as necessary."); | 104 print("Copy or rename it to prosody.cfg.lua and edit as necessary."); |
105 end | 105 end |
106 print("More help on configuring Prosody can be found at http://prosody.im/doc/configure"); | 106 print("More help on configuring Prosody can be found at http://prosody.im/doc/configure"); |
107 print("Good luck!"); | 107 print("Good luck!"); |