lua-users home
lua-l archive

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


Correct.
But only for error and exception handling.

I don't need it to handle an failure or an exception, its normal case - so there should be a normal function to do this, without such a big (and good working!) workaround, which Romulo posted.

Just posted mainly to help improving lua with what is often needed in developing web. applications. But you are correct, depends on the point of view, and where(/how often) you need such functionality.

Kind regards,
 Jan (DracoBlue)
---------------------------
   http://dracoblue.net

Jerome Vuarand schrieb:
Jan Schütze wrote:
so I should call the mainfunction with pcall and ignore its message this way?
Hmm, should be possible - but looks like an evil hack :-).

In fact it's not an evil hack, it's the way error management works in Lua. It's similar to exceptions in C++. Whether Lua errors or C++ exceptions are a good way to report errors is a religious debate, but in both case it's a reliable, well defined and powerful mechanism. Whether you use it or abuse it is up to you.