1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-07 07:50:27 +00:00

Show HTTP error in wget (#2037)

This commit is contained in:
tizu 2024-12-22 17:45:04 +01:00 committed by GitHub
parent 4dc649d5e5
commit 7e2f490626
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,7 @@ local function getFilename(sUrl)
return sUrl:match("/([^/]+)$")
end
local function get(sUrl)
local function get(url)
-- Check if the URL is valid
local ok, err = http.checkURL(url)
if not ok then
@ -43,12 +43,12 @@ local function get(sUrl)
return
end
write("Connecting to " .. sUrl .. "... ")
write("Connecting to " .. url .. "... ")
local response = http.get(sUrl)
local response, err = http.get(url)
if not response then
print("Failed.")
return nil
printError(err)
return
end
print("Success.")