lua-users home
lua-l archive

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


Quoting Nick Davies <goodbytes@binarysurge.com>:
If I remember correctly, what you want is lua_pcall and not
lua_call. pcall runs the code "protected", so that it can
catch errors. If you don't do that, the error handleer just
exits out.

What I can't remember is if the error messages get displayed
for you, or if they get returned on the stack and you have
to print them yourself.

> Quite often, my program will simply quit after a call to
> lua_call() without
> giving any sort of error message, and it's usually(i.e.
> always) due to some
> mistake I made in lua files(such as trying to access an
> entry in a table
> that doesn't exist). I assume that I'm doing things wrong
> here - how do I
> get error messages from Lua to appear so that I can see
> what's going on
> instead of relying on trial and error?
> 
> Thanks in advance,
> ~Nick
> 
> 
>