lua-users home
lua-l archive

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


Thank you, that works!

At the end I gave up on compiling lua as C++, and I manually check
(via a "wrapper" function to lua_pcall) every call for errors.

Still it would be nice if it were possible just to have Lua throw
std::exceptions containing the error message when lua is compiled as
C++.


Regards,
Stefano

On 19 February 2011 01:09, GrayFace <sergroj@mail.ru> wrote:
> 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                 mailto:sergroj@mail.ru
>
>
>
>