mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-08 08:20:29 +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("/([^/]+)$")
|
return sUrl:match("/([^/]+)$")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get(sUrl)
|
local function get(url)
|
||||||
-- Check if the URL is valid
|
-- Check if the URL is valid
|
||||||
local ok, err = http.checkURL(url)
|
local ok, err = http.checkURL(url)
|
||||||
if not ok then
|
if not ok then
|
||||||
@ -43,12 +43,12 @@ local function get(sUrl)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
write("Connecting to " .. sUrl .. "... ")
|
write("Connecting to " .. url .. "... ")
|
||||||
|
|
||||||
local response = http.get(sUrl)
|
local response, err = http.get(url)
|
||||||
if not response then
|
if not response then
|
||||||
print("Failed.")
|
printError(err)
|
||||||
return nil
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
print("Success.")
|
print("Success.")
|
||||||
|
Loading…
Reference in New Issue
Block a user