lua-users home
lua-l archive

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

On Mar 29, 2006, at 20:12, Roberto Ierusalimschy wrote:

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.)

Hmmm... this is a bit disconcerting. What's the rational behind this
behavior? After all, an error is an error, message or not.

The rationale is to allow errors without messages :) An error is an error,
and a message is a message. If the error does not have a message, it
probably does not want one.

Or perhaps I mistyped the variable name representing the message. Or I just would like to throw an exception and see the stack trace as I usually do. Or...

I thought that error() always added the error position:

"With level 1 (the default), the error position is where the error function was called"

Isn't error() the equivalent of error( nil, 1 )?

Isn't the purpose of the 'level 0' parameter to "avoids the addition of error position information to the message"?

Wouldn't a 'silent' error look like this:

error( nil, 0 )

Very confusing :/


PA, Onnay Equitursay