Fixed handling Lua errors in nested callbacks (#3755)
This commit is contained in:
@@ -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 }]])
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user