comparison main.lua @ 230:e46525f5b2a4

We don't fail if modules fail to load at startup :)
author Waqas Hussain <waqas20@gmail.com>
date Sun, 09 Nov 2008 05:24:47 +0500
parents 01bd24ea488d
children 5dc6ae7b5ce8
comparison
equal deleted inserted replaced
229:01bd24ea488d 230:e46525f5b2a4
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 if not modulemanager.load(module) then 44 modulemanager.load(module);
45 error("Unable to load module "..module);
46 end
47 end 45 end
48 else error("No modules enabled in the configuration file"); end 46 else error("No modules enabled in the configuration file"); end
49 47
50 -- setup error handling 48 -- setup error handling
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 }) --]][][[]][]; 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 }) --]][][[]][];