ignore json parsing error
This commit is contained in:
parent
30f7203c5f
commit
4dec8003ed
1 changed files with 3 additions and 3 deletions
|
@ -84,8 +84,8 @@ function tools.req(url, par, f, dbg)
|
||||||
if dbg then print(url, succ, res, par)
|
if dbg then print(url, succ, res, par)
|
||||||
-- dump(par))
|
-- dump(par))
|
||||||
end
|
end
|
||||||
res = json.decode(res or '{}')
|
local s, res = pcall(json.decode, res or '{}')
|
||||||
if not succ or not res then return {}, false end
|
if not s or not succ or not res then return {}, false end
|
||||||
return res, true
|
return res, true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue