200 |
200 |
201 local runner = async.runner(function () |
201 local runner = async.runner(function () |
202 for i, action in ipairs(script.actions) do |
202 for i, action in ipairs(script.actions) do |
203 local object = script.objects[action.object_name]; |
203 local object = script.objects[action.object_name]; |
204 local handler = object.handler; |
204 local handler = object.handler; |
205 assert(handler[action.action], "Objects of type '"..object.type.."' do not support action '"..action.action.."'"); |
205 if not handler[action.action] then |
206 |
206 local e = new_error("unsupported-action", { |
|
207 text = "Objects of type '"..object.type.."' do not support action '"..action.action.."'"; |
|
208 }); |
|
209 error(e); |
|
210 end |
207 if server_log_reader then |
211 if server_log_reader then |
208 log_data("server", { lines = server_log_reader() }); |
212 log_data("server", { lines = server_log_reader() }); |
209 end |
213 end |
210 log_data("action", { |
214 log_data("action", { |
211 action = action.action; |
215 action = action.action; |