return original error info when response failed
This commit is contained in:
+5
-6
@@ -75,13 +75,12 @@ local function verifyJwtToken(token)
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not res then
|
if not res then
|
||||||
ngx.status = ngx.HTTP_UNAUTHORIZED
|
|
||||||
ngx.header.content_type = "application/json; charset=utf-8"
|
|
||||||
ngx.log(ngx.ERR, "CAN'T VERIFY JWT TOKEN -> ", err)
|
ngx.log(ngx.ERR, "CAN'T VERIFY JWT TOKEN -> ", err)
|
||||||
ngx.exit(ngx.HTTP_UNAUTHORIZED)
|
ngx.exit(ngx.HTTP_FORBIDDEN)
|
||||||
else
|
else
|
||||||
if 200 ~= res.status then
|
if 200 ~= res.status then
|
||||||
ngx.log(ngx.ERR, "JWT TOKEN VERIFICATION *ERROR* -> ", err)
|
ngx.log(ngx.ERR, "JWT TOKEN VERIFICATION *ERROR* -> ", err)
|
||||||
|
ngx.say(res.body)
|
||||||
ngx.exit(res.status)
|
ngx.exit(res.status)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -195,11 +194,11 @@ while true do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if 201 ~= res.status then
|
if 201 ~= res.status then
|
||||||
ngx.log(ngx.ERR, "TASK CREATE *FAILED*", err)
|
ngx.log(ngx.ERR, "TASK CREATE *FAILED*", res.body)
|
||||||
ngx.say(err)
|
|
||||||
ngx.exit(res.status)
|
|
||||||
end
|
end
|
||||||
ngx.say(res.body)
|
ngx.say(res.body)
|
||||||
|
ngx.exit(res.status)
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
-- do nothing
|
-- do nothing
|
||||||
|
|||||||
@@ -45,11 +45,10 @@ local function create_task()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if 201 ~= res.status then
|
if 201 ~= res.status then
|
||||||
ngx.log(ngx.ERR, "TASK CREATE *FAILED*", err)
|
ngx.log(ngx.ERR, "TASK CREATE *FAILED*", res.body)
|
||||||
ngx.say(err)
|
|
||||||
ngx.exit(res.status)
|
|
||||||
end
|
end
|
||||||
ngx.say(res.body)
|
ngx.say(res.body)
|
||||||
|
ngx.exit(res.status)
|
||||||
end
|
end
|
||||||
|
|
||||||
create_task()
|
create_task()
|
||||||
|
|||||||
Reference in New Issue
Block a user