set abc 123
zadd z 0 abc
eval "local c=redis.pcall('get', KEYS[1]) if (c.err) then return c.err else return c end" 1 abc
eval "local c=redis.pcall('get', KEYS[1]) if (c.err) then return c.err else return c end" 1 z
当调用redis.pcall的过程中有出现错误,则redis.pcall调用返回带有err域的Table。
通过c.err来判断此域是否为空。
如不为空则表示有错误发生。为空则无错,是正常执行的结果。