return error message

This commit is contained in:
2022-06-26 18:46:36 +08:00
parent 99d0ef75b2
commit 9bcbbe5208
+7 -3
View File
@@ -39,12 +39,16 @@ local function get_access_token()
ngx.say(pl.write(resp_err))
ngx.exit(resp.status)
else
ngx.log(ngx.ERR, "RESP IS OK -> ", pl.write(resp.body))
ngx.log(ngx.ERR, "RESP IS OK -> ", pl.write(resp.body))
return cjson.decode(resp.body).d
end
else
ngx.log(ngx.ERR, "FAILED TO CONNECT TO *HTYUC* RESP STATUS ->", resp.status)
ngx.exit(resp.status)
if resp == nil then
resp = ""
end
ngx.log(ngx.ERR, "FAILED TO CONNECT TO *HTYUC*: httpc throws runtime error, please check HTYUC log. / ", pl.write(resp))
ngx.say(pl.write(resp))
ngx.exit(401)
end
end