util.pluginloader: Remove unnecessary return value suppressing the real load error
[prosody.git] / util / serialization.lua
index bff0f306fef5ae0f78e1ba75f094ae7df02cedb4..1ffd3e16497be7e845e8d89a072a65852b962749 100644 (file)
@@ -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