Error handling – Lua error handling

I am new to lua.

I tried to use
http://keplerproject.github.io/luafilesystem/examples.html< br>and it throws an error on the inaccessible directory.

This seems to be caused by luaL_error https://github.com/keplerproject/luafilesystem/blob/master/src/lfs.c#L563

How can I catch this error?
http://www.tutorialspoint.com/lua/lua_error_handling.htm
Pcall is recommended, but this will not prevent the script from dying:

pcall(lfs. dir('/etc/passwd')) #this fails to handle the not a directory error

pcall(lfs.dir(‘/etc/passwd’)) failed because the error was triggered outside of pcall (when calculating the parameters of pcall). You need to use

local ok, res = pcall(lfs.dir,'/etc/passwd')

Please note that the parameters passed to lfs.dir are for pcall, not lfs.dir.

I am new to lua.

I tried to use
http://keplerproject.github.io/luafilesystem/ examples.html
and it throws an error on an inaccessible directory.

This seems to be caused by luaL_error https://github.com/keplerproject/luafilesystem/blob/master/src/lfs.c #L563 caused

How can I catch this error?
http://www.tutorialspoint.com/lua/lua_error_handling.htm
Pcall is recommended, but this will not prevent the script from dying:

pcall(lfs. dir('/etc/passwd')) #this fails to handle the not a directory error

pcall(lfs.dir(‘/ etc / passwd’ )) failed because the error was triggered outside of pcall (when calculating the parameters of pcall). You need to use

local ok, res = pcall(lfs .dir,'/etc/passwd')

Please note that the parameters passed to lfs.dir are for pcall, not lfs.dir.

< /p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3281 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.