From a43befabd2dd4fcb91f37b3e2a20774c57c2d7e8 Mon Sep 17 00:00:00 2001 From: Taso Date: Thu, 29 Apr 2021 09:10:50 -0400 Subject: [PATCH] fix(update): Fixed failure message on 200 code --- update.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update.lua b/update.lua index d722d6c..554c281 100644 --- a/update.lua +++ b/update.lua @@ -2,7 +2,7 @@ CreateThread(function() local localName = GetCurrentResourceName() local resourceName = (localName == 't-notify') and "^2[t-notify]^0" or ("^2[t-notify] ^2(%s)^0"):format(localName) - local function checkVersionHandler(err, responseText) + local function checkVersionHandler(respCode, responseText) local curVersion = LoadResourceFile(localName, "version") if not responseText or not curVersion then @@ -25,8 +25,8 @@ CreateThread(function() print("^1###############################") elseif(tonumber(curVersion) > tonumber(responseText)) then print(("You may be using a pre-release of %s. Your version: ^1%s^0, GitHub version: ^2%s"):format(resourceName, curVersion, responseText)) - elseif err then - print(("%s - Error in checking for update"):format(resourceName)) + elseif respCode < 200 or respCode > 299 then + print(("%s - Error in checking for update, error code %s"):format(resourceName, errCode)) else print(resourceName.. '(v' .. responseText .. ") is up to date and has started") end