mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2026-01-04 15:49:57 +01:00
improve error message in case the lua script can't download a file
Now prints the actual error message from the http library instead of a generic "Could not connect" message.
This commit is contained in:
parent
bc797d36b9
commit
81db3b13db
|
|
@ -169,7 +169,8 @@ function download_file(fileurl)
|
|||
local headers, stream = req:go(req_timeout)
|
||||
|
||||
if headers == nil then
|
||||
io.stderr:write(string.format("Failed to download %s: Could not connect\n", fileurl))
|
||||
--- the second return variable (=stream) contains the error message in case of an error
|
||||
io.stderr:write(string.format("Failed to download %s: %s\n", fileurl, stream))
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue