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:
@@ -266,7 +266,7 @@ function API:_send(method, path, query_args, body, headers, api_path)
|
|||||||
end
|
end
|
||||||
return body
|
return body
|
||||||
else
|
else
|
||||||
return error("HTTP " .. code .. " - " .. body)
|
return error("HTTP " .. tostring(code) .. " - " .. body)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user