diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-05-04 19:35:29 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-05-04 19:35:29 +0100 |
commit | 7229cd0025d267a08d50d16e04457a863ffd12b9 (patch) | |
tree | 25b41b25a4d1f4bb682e3d855459f0d8b3259bdc /util/serialization.lua | |
parent | 21c08d9f27ba85bf8f6ec07905556c93c254c232 (diff) | |
download | prosody-7229cd0025d267a08d50d16e04457a863ffd12b9.tar.gz prosody-7229cd0025d267a08d50d16e04457a863ffd12b9.zip |
util.serialization: Log a warning when trying to serialize something we can't
Diffstat (limited to 'util/serialization.lua')
-rw-r--r-- | util/serialization.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/serialization.lua b/util/serialization.lua index bff0f306..41d963e9 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -14,6 +14,8 @@ local t_concat = table.concat; 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 @@ local function _simplesave(o, ind, t, func) 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 |