diff --git a/kong/kong.lua b/kong/kong.lua index 120714a33907..c931b2589965 100644 --- a/kong/kong.lua +++ b/kong/kong.lua @@ -221,9 +221,10 @@ function Kong.balancer() local ok, err = balancer_execute(addr) if not ok then - return responses.send_HTTP_INTERNAL_SERVER_ERROR("failed to retry the ".. - "dns/balancer resolver for '"..addr.upstream.host.. - "' with: "..tostring(err)) + ngx.log(ngx.ERR, "failed to retry the dns/balancer resolver for ", + addr.upstream.host, "' with: ", tostring(err)) + + return responses.send(500) end else -- first try, so set the max number of retries @@ -236,9 +237,11 @@ function Kong.balancer() -- set the targets as resolved local ok, err = set_current_peer(addr.ip, addr.port) if not ok then - ngx.log(ngx.ERR, "failed to set the current peer (address:'", - tostring(addr.ip),"' port:",tostring(addr.port),"): ", tostring(err)) - return responses.send_HTTP_INTERNAL_SERVER_ERROR() + ngx.log(ngx.ERR, "failed to set the current peer (address: ", + tostring(addr.ip), " port: ", tostring(addr.port),"): ", + tostring(err)) + + return responses.send(500) end ok, err = set_timeouts(addr.connect_timeout / 1000,