util.pluginloader: Remove unnecessary return value suppressing the real load error
[prosody.git] / util / serialization.lua
index dd6dd5b51423f58f8ec68e24ba1f0f8246eebfde..1ffd3e16497be7e845e8d89a072a65852b962749 100644 (file)
@@ -1,6 +1,6 @@
--- Prosody IM v0.2
--- Copyright (C) 2008 Matthew Wild
--- Copyright (C) 2008 Waqas Hussain
+-- Prosody IM v0.4
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
 -- 
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
@@ -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,8 @@ 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("error", "cannot serialize a %s: %s", type(o), debug_traceback())
+               func(t, "nil");
        end
 end