Mercurial > prosody-hg
comparison main.lua @ 229:01bd24ea488d
We now fail if modules fail to load at startup.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sun, 09 Nov 2008 04:26:25 +0500 |
| parents | 4b1e30ddd2bb |
| children | e46525f5b2a4 |
comparison
equal
deleted
inserted
replaced
| 228:875842235836 | 229:01bd24ea488d |
|---|---|
| 39 ------------------------------------------------------------------------ | 39 ------------------------------------------------------------------------ |
| 40 | 40 |
| 41 -- Initialise modules | 41 -- Initialise modules |
| 42 if config.modules and #config.modules > 0 then | 42 if config.modules and #config.modules > 0 then |
| 43 for _, module in pairs(config.modules) do | 43 for _, module in pairs(config.modules) do |
| 44 modulemanager.load(module); | 44 if not modulemanager.load(module) then |
| 45 error("Unable to load module "..module); | |
| 46 end | |
| 45 end | 47 end |
| 46 else error("No modules enabled in the configuration file"); end | 48 else error("No modules enabled in the configuration file"); end |
| 47 | 49 |
| 48 -- setup error handling | 50 -- setup error handling |
| 49 setmetatable(_G, { __index = function (t, k) print("WARNING: ATTEMPT TO READ A NIL GLOBAL!!!", k); error("Attempt to read a non-existent global. Naughty boy.", 2); end, __newindex = function (t, k, v) print("ATTEMPT TO SET A GLOBAL!!!!", tostring(k).." = "..tostring(v)); error("Attempt to set a global. Naughty boy.", 2); end }) --]][][[]][]; | 51 setmetatable(_G, { __index = function (t, k) print("WARNING: ATTEMPT TO READ A NIL GLOBAL!!!", k); error("Attempt to read a non-existent global. Naughty boy.", 2); end, __newindex = function (t, k, v) print("ATTEMPT TO SET A GLOBAL!!!!", tostring(k).." = "..tostring(v)); error("Attempt to set a global. Naughty boy.", 2); end }) --]][][[]][]; |
