lua-users home
lua-l archive

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


> By experimentation, I just found that error() produces no output (just 
> what I wanted), but the manual doesn't document this case. Is this an 
> oversight, or is the behaviour non-standard? (I'm using John Belmonte's 
> Debian package.)

It is standard (now). But this is not a property of error (although it
colaborates), but of lua.c. Since Lua 5.0 (?) error can throw any object
as the "error message". In 5.1, error() throws nil as the error message.
(This is not big deal; several functions now handle nil and no-argument
in the same way.)  The main change is that lua.c checks the error object
and, if it is nil, it does not show anything. (See 'report' in lua.c.)

-- Roberto