Always stringigy returned HTTP status code for logging

This avoids the potential issue in which the status code would be "nil" or
"false", which HTTP client libraries may choose to signal an error condition.
This commit is contained in:
Adrian Perez de Castro
2016-06-28 23:21:04 +03:00
parent 724d7cdd54
commit 28477c4db7

View File

@@ -266,7 +266,7 @@ function API:_send(method, path, query_args, body, headers, api_path)
end
return body
else
return error("HTTP " .. code .. " - " .. body)
return error("HTTP " .. tostring(code) .. " - " .. body)
end
end