Changeset

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
parents 1106:b51a65066595
children 1108:368754c54045
files util/serialization.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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