Diff

util/serialization.lua @ 1107:ebda1845ebc1

util.serialization: Log a warning when trying to serialize something we can't
author Matthew Wild <mwild1@gmail.com>
date Mon, 04 May 2009 19:35:29 +0100
parent 896:2c0b9e3c11c3
child 1128:b2e548344d61
line wrap: on
line diff
--- a/util/serialization.lua	Mon May 04 19:28:16 2009 +0100
+++ b/util/serialization.lua	Mon May 04 19:35:29 2009 +0100
@@ -14,6 +14,8 @@
 local error = error;
 local pairs = pairs;
 
+local debug_traceback = debug.traceback;
+local log = require "util.logger".init("serialization");
 module "serialization"
 
 local indent = function(i)
@@ -50,7 +52,7 @@
 	elseif type(o) == "boolean" then
 		func(t, (o and "true" or "false"));
 	else
-		error("cannot serialize a " .. type(o))
+		log("warn", "cannot serialize a %s: %s", type(o), debug_traceback())
 	end
 end