From 9f774cf169c411aa6c922da715765e66256da78c Mon Sep 17 00:00:00 2001 From: osmarks Date: Mon, 13 Aug 2018 11:23:46 +0100 Subject: [PATCH] Handle error correctly --- backend-chests.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-chests.lua b/backend-chests.lua index 4273782..1552972 100644 --- a/backend-chests.lua +++ b/backend-chests.lua @@ -136,7 +136,7 @@ local function server(command) local quantity_missing = 0 if not first_available then quantity_missing = command.quantity or 1 elseif command.quantity and command.quantity > first_available.item.count then quantity_missing = command.quantity - first_available.item.count end - if quantity_missing > 0 then return w.errors.make(w.errors.NOITEMS, { type = w.get_internal_identifier(command), quantity = quantity_missing }) end + if quantity_missing > 0 then error(w.errors.make(w.errors.NOITEMS, { type = w.get_internal_identifier(command), quantity = quantity_missing })) end local items_moved_from_storage = fetch_by_location(first_available.location, command.quantity)