return error message

This commit is contained in:
2022-06-26 18:46:36 +08:00
parent 99d0ef75b2
commit 9bcbbe5208
+6 -2
View File
@@ -43,8 +43,12 @@ local function get_access_token()
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