# HG changeset patch # User Matthew Wild # Date 1545997136 0 # Node ID fadae5511044b5cd46a9e6ef4547eb3298e0b1c2 # Parent 28aa762f11c727d710bafc7a6b13b758e7e43bcd main: Make undefined actions throw a proper scansion error diff -r 28aa762f11c7 -r fadae5511044 main.lua --- a/main.lua Fri Dec 28 04:41:09 2018 -0500 +++ b/main.lua Fri Dec 28 11:38:56 2018 +0000 @@ -202,8 +202,12 @@ for i, action in ipairs(script.actions) do local object = script.objects[action.object_name]; local handler = object.handler; - assert(handler[action.action], "Objects of type '"..object.type.."' do not support action '"..action.action.."'"); - + if not handler[action.action] then + local e = new_error("unsupported-action", { + text = "Objects of type '"..object.type.."' do not support action '"..action.action.."'"; + }); + error(e); + end if server_log_reader then log_data("server", { lines = server_log_reader() }); end