pcall
来源:互联网 发布:中国知网的数据库 编辑:程序博客网 时间:2024/05/17 03:17
If you need to handle errors in Lua, you must use the pcall (protected call) function to encapsulate your code.
The pcall function calls its first argument in protected mode, so that it catches any errors while the function is running. If there are no errors, pcall returns true, plus any values returned by the call. Otherwise, it returns false, plus the error message.
local status, err = pcall(function() error({code=121})end)print(err.code) --> 121
0 0
- pcall
- pcall
- lua pcall
- Lua的pcall函数
- pcall()处理异常
- lua: pcall xpcall debug
- lua pcall 异常处理
- Lua的pcall函数
- Lua的pcall函数
- Lua中的pcall,xpcall
- Lua的pcall函数
- lua pcall error
- Lua的pcall错误处理
- Lua的pcall错误处理
- 在Lua的pcall内部崩溃
- Lua 异常处理 pcall xpcall debug
- redis.pcall返回错误的处理
- Lua的pcall错误处理定位行号
- MySQL检查运行的mysqld服务器是否支持OpenSSL
- poj 2388 Who's in the Middle 排序,大水
- windows内存模式
- AngularJS 开篇啦
- 单例
- pcall
- 不得不吐槽的百度推送
- HTML中几种常见单位
- JMeter 下Javascript实现assert的注意点
- postman 发送json请求
- 收音机(FM2)加入自动唤醒功能
- Archive将多个对象归档到同一个文件
- openCV中IplImage的使用
- 我的第一个任务:handyscope接线