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