mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-20 16:37:39 +00:00
Show HTTP error in wget (#2037)
This commit is contained in:
@@ -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.")
|
||||
|
Reference in New Issue
Block a user