From 81db3b13dbb3f5115918cf38db80cb2752c3c07f Mon Sep 17 00:00:00 2001 From: "Gerd v. Egidy" Date: Sun, 7 Aug 2022 12:53:16 +0200 Subject: [PATCH] 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. --- airootfs/usr/bin/sysrescue-configuration.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airootfs/usr/bin/sysrescue-configuration.lua b/airootfs/usr/bin/sysrescue-configuration.lua index 2518b1f..7b96abf 100755 --- a/airootfs/usr/bin/sysrescue-configuration.lua +++ b/airootfs/usr/bin/sysrescue-configuration.lua @@ -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