Skip to content

Commit

Permalink
fix(update): Fixed failure message on 200 code
Browse files Browse the repository at this point in the history
  • Loading branch information
TasoOneAsia committed Apr 29, 2021
1 parent 8e0f2bc commit a43befa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a43befa

Please sign in to comment.