From 28477c4db7f30e634cbdd5c4bd0334f844cb41b4 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Tue, 28 Jun 2016 23:21:04 +0300 Subject: [PATCH] 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. --- matrix/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix/api.lua b/matrix/api.lua index 0611619..8012b5a 100644 --- a/matrix/api.lua +++ b/matrix/api.lua @@ -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