errors in config file now cause message & quit
This commit is contained in:
parent
a418859589
commit
7be49eace7
6
ldoc.lua
6
ldoc.lua
|
@ -135,7 +135,7 @@ local function read_ldoc_config (fname)
|
||||||
local txt,not_found = utils.readfile(fname)
|
local txt,not_found = utils.readfile(fname)
|
||||||
if txt then
|
if txt then
|
||||||
-- Penlight defines loadin for Lua 5.1 as well
|
-- Penlight defines loadin for Lua 5.1 as well
|
||||||
local chunk,err
|
local chunk
|
||||||
if not loadin then -- Penlight 0.9.5
|
if not loadin then -- Penlight 0.9.5
|
||||||
chunk,err = load(txt,nil,nil,ldoc)
|
chunk,err = load(txt,nil,nil,ldoc)
|
||||||
else
|
else
|
||||||
|
@ -144,9 +144,9 @@ local function read_ldoc_config (fname)
|
||||||
if chunk then
|
if chunk then
|
||||||
local ok
|
local ok
|
||||||
ok,err = pcall(chunk)
|
ok,err = pcall(chunk)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if err then print('error loading config file '..fname..': '..err) end
|
if err then quit('error loading config file '..fname..': '..err) end
|
||||||
for k in pairs(ldoc) do
|
for k in pairs(ldoc) do
|
||||||
if not ldoc_contents[k] then
|
if not ldoc_contents[k] then
|
||||||
quit("this config file field/function is unrecognized: "..k)
|
quit("this config file field/function is unrecognized: "..k)
|
||||||
|
|
Loading…
Reference in New Issue