response error msg
This commit is contained in:
@@ -95,12 +95,6 @@ local function parseGiteaURL(url)
|
||||
info.treeUrl =
|
||||
("%s%s/api/v1/repos/%s/%s/git/trees/%s?recursive=1")
|
||||
:format(info.protocol, info.origin, info.owner, info.repo, info.branch)
|
||||
print()
|
||||
print("protocol: ", info.protocol)
|
||||
print("origin: ", info.origin)
|
||||
print("owner: ", info.owner)
|
||||
print("repo: ", info.repo)
|
||||
print("treeUrl: ", info.treeUrl)
|
||||
for k, v in pairs(info) do
|
||||
if v == "" or v == nil then
|
||||
error("Could not parse " .. k .. " from link.")
|
||||
@@ -118,8 +112,8 @@ local function downloadFile(base, owner, repo, branch, path, target)
|
||||
req.headers = { Authorization = "token " .. GIT_TOKEN }
|
||||
end
|
||||
|
||||
local response = http.get(req)
|
||||
if not response then error("Failed to download: " .. path) end
|
||||
local response, err = http.get(req)
|
||||
if not response then error("Failed to download: " .. path .. "due to: " .. err) end
|
||||
|
||||
local data = response.readAll()
|
||||
response.close()
|
||||
|
||||
Reference in New Issue
Block a user