From aeae9df0019b3641a7ebf4d3c262fc1789708894 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 27 Apr 2018 17:13:42 +0200
Subject: [PATCH] check_site: improve error message for unset values

---
 scripts/check_site.lua | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/check_site.lua b/scripts/check_site.lua
index 3fca6a8cf..8e749c939 100644
--- a/scripts/check_site.lua
+++ b/scripts/check_site.lua
@@ -108,7 +108,12 @@ local function var_error(path, val, msg)
 		src = site_src()
 	end
 
-	config_error(src, 'expected %s to %s, but it is %s (a %s value)', path_to_string(path), msg, tostring(val), type(val))
+	local found = 'unset'
+	if val ~= nil then
+		found = string.format('%s (a %s value)', tostring(val), type(val))
+	end
+
+	config_error(src, 'expected %s to %s, but it is %s', path_to_string(path), msg, found)
 end
 
 
-- 
GitLab