diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua index 44de78b78..917ca9036 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua @@ -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.")