Changeset

2347:f36cd334e7a6

prosody: Log a warning and traceback, but don't throw an error on nil global read.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 10 Dec 2009 02:47:13 +0500
parents 2346:f5c8f727b2a9
children 2348:c7e5ed5eca99
files prosody
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/prosody	Thu Dec 10 01:56:16 2009 +0500
+++ b/prosody	Thu Dec 10 02:47:13 2009 +0500
@@ -296,7 +296,7 @@
 function init_global_protection()
 	-- Catch global accesses
 	local locked_globals_mt = {
-		__index = function (t, k) error("Attempt to read a non-existent global '"..k.."'", 2); end;
+		__index = function (t, k) log("warn", "%s", debug.traceback("Attempt to read a non-existent global '"..k.."'", 2)); end;
 		__newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end;
 	};