Fixed handling Lua errors in nested callbacks (#3755)

This commit is contained in:
Mattes D
2017-06-09 12:16:31 +02:00
committed by Lukas Pioch
parent 7922e6addb
commit 3c4e443ddc
4 changed files with 60 additions and 3 deletions
+12
View File
@@ -2279,6 +2279,18 @@ end
function HandleConsoleTestErr(a_Split, a_EntireCmd)
cRoot:Get():GetDefaultWorld():ForEachEntity(
function (a_CBEntity)
error("This error should not abort the server")
end
)
end
function HandleConsoleTestJson(a_Split, a_EntireCmd)
LOG("Testing Json parsing...")
local t1 = cJson:Parse([[{"a": 1, "b": "2", "c": [3, "4", 5], "d": true }]])
+6
View File
@@ -350,6 +350,12 @@ g_PluginInfo =
HelpString = "Tests inter-plugin calls with various values"
},
["testerr"] =
{
Handler = HandleConsoleTestErr,
HelpString = "Tests the server's ability to recover from errors in callbacks (GH #3733)",
},
["testjson"] =
{
Handler = HandleConsoleTestJson,