Time: 2024年2月8日20:21:17 by:MemoryErHero
1 异常代码
Expected value but found T_END at character 1
2 异常代码
Expected value but found T_OBJ_END at character 22
3 处理方案 - 正确 json 示范
while true do--Expected value but found T_END at character 1--Expected value but found T_OBJ_END at character 22local str = '{"success":0,"code":[]}'local err,tbl = pcall(function(str)return jsonLib.decode(str)end,str)print(err)print(tbl)sleep(1000)
end
4 处理方案 - 错误 json 示范
while true do--Expected value but found T_END at character 1--Expected value but found T_OBJ_END at character 22local str = '{"success":0,"code":[}'local err,tbl = pcall(function(str)return jsonLib.decode(str)end,str)print(err)print(tbl)sleep(1000)
end