lua-users home
lua-l archive

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


David Burgess wrote around Fri 16 Sep 17:13:
> In fact methinks xpcall() is what you need.

But that does not give me control over the actual call stack depth
where I can report the error such that I can use the level argument to
error().  Great sentence that, sorry  :-)

In order to use the level argument of error(), I need to be aware how
deep I am in the call stack with respect to my conf file.  For the
functions I write myself, I can engineer this to be always known, but
as soon as I step off my code into library land, I have no more
control.  So, calling all library function using pcall() allows me to
then check the error status and report the error in my own function,
where I still know how deep I currently stand.

Hoping this makes sense,
Robby