scripts/check_site_lib.lua: improve display of invalid values

This commit is contained in:
Matthias Schiffer 2018-01-19 10:59:45 +01:00
parent 7ccdacd294
commit 43628c1679
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -16,6 +16,10 @@ local function array_to_string(array)
end end
local function var_error(path, val, msg) local function var_error(path, val, msg)
if type(val) == 'string' then
val = string.format('%q', val)
end
print(string.format('*** site.conf error: expected %s to %s, but it is %s', path_to_string(path), msg, tostring(val))) print(string.format('*** site.conf error: expected %s to %s, but it is %s', path_to_string(path), msg, tostring(val)))
os.exit(1) os.exit(1)
end end