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:
parent
4dc649d5e5
commit
7e2f490626
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user