Make errors from IO be properly printed

This commit is contained in:
osmarks 2018-08-15 18:14:02 +01:00
parent b72644dc5f
commit c360c72f83

5
IO.lua
View File

@ -18,6 +18,7 @@ local function get_num_stacks(total_items)
return math.ceil(total_items / 64) return math.ceil(total_items / 64)
end end
local function main()
while true do while true do
local stacks_stored = d.map(d.filter(chest.list(), function(x) return x ~= nil end), w.to_wyvern_item) local stacks_stored = d.map(d.filter(chest.list(), function(x) return x ~= nil end), w.to_wyvern_item)
local items_stored = w.collate_stacks(stacks_stored) local items_stored = w.collate_stacks(stacks_stored)
@ -54,3 +55,7 @@ while true do
sleep(conf.sleep_time) sleep(conf.sleep_time)
end end
end
local ok, err = pcall(main)
print(w.errors.format(err))