lua 错误
Lua 的强大错误处理功能,其特点是:
try() , catch() , finally()函数
自定义错误对象
快的
-- import creates a base Error class and global funcs try(), catch(), finally()
local Error = require ' lua_error '
-- do this anywhere in your code:
try {
function ()
-- make a call which could raise an error
end ,
catch {
function ( err )
-- handle the error
end
},
finally {
function ()
--
2021-06-07 16:04:08
11KB
Lua
1