From cbafc49e8acf71bf39c0db9d32c393437b3e20db Mon Sep 17 00:00:00 2001 From: rxi Date: Wed, 12 Mar 2014 21:12:16 +0000 Subject: [PATCH] Added "unsupported type" error to lume.serialize() The unsupported type error is raised if an unsupported type is encountered in the table we are trying to serialize. --- lume.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lume.lua b/lume.lua index b06980d..d13f03d 100644 --- a/lume.lua +++ b/lume.lua @@ -245,6 +245,8 @@ function lume.serialize(x) end return "{" .. table.concat(rtn) .. "}" end + local err = function(t,k) error("unsupported serialize type: " .. k) end + setmetatable(f, { __index = err }) return f[type(x)](x) end