lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 18.02.2011 5:02, S wrote:
To sum up, I need a way to make sure that all errors in Lua  (which
may happen in say lua_dofile() or lua_call()) result in a
std::exception being thrown (which I will catch in my C++ code).

If it is possible, it would really help the debugging if an
informative message were included in the exception (like: "Parsing
error at line 24 of file.lua").

Any help / comment is greatly welcome.

Use lua_pcall. If if fails, you can throw an exception yourself if you want to.

Best regards,
Sergey Rozhenko