C 捕获 lua 异常错误

参考文章https://blog.codingnow.com/2015/05/lua_c_api.html

 

    if(lua_pcall(m_pLua, 0, 1, 0)) {
     printf("file=%s, func=%s, line=%d\n", __FILE__, __FUNCTION__,__LINE__);
     printf("error %s\n", lua_tostring(m_pLua,-1));
     TRACE_ERR("file=%s, func=%s, line=%d\n", __FILE__, __FUNCTION__,__LINE__);
     TRACE_ERR("error %s\n", lua_tostring(m_pLua,-1));
     exit(1);
   }

 

posted @ 2017-11-30 17:29  cogitoergosum  阅读(635)  评论(0编辑  收藏  举报