改进后的luaCaller
function luaErrHandler(err)
print("lua error", err)
print(debug.traceback())
os.exit() -- force exit
end
function luaCaller(module, func, params)
if(params=="") then
tableParams ={}
else
tableParams = json.decode(params)
end
luaFunc =loadstring("return " .. module .. "." .. func .. "(tableParams)");
isSuccess, result = xpcall(luaFunc, luaErrHandler)
return json.encode(result)
end