error handling

This commit is contained in:
kepler155c@gmail.com
2018-02-06 08:45:43 -05:00
parent cceb6c8409
commit f16c7b632b
3 changed files with 10 additions and 0 deletions

View File

@@ -69,7 +69,11 @@ Event.addRoutine(function()
break
end
if peripheral[data.fn] then
-- need to trigger an error on the other end
-- local s, m = pcall()
socket:write({ peripheral[data.fn](table.unpack(data.args)) })
else
socket:write({ false, "Invalid function: " .. data.fn })
end
end