lua-users home
lua-l archive

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



In regards to the discussion concerning non-string error values, there is a certain detail of Lua that in my opinion would deserve a change.

The 'lua_pcall' function allows an error handler, which can grab the error message and modify it accordingly (normally, to add stack trace). This implies that the error "message" (as it is called in documentation) is a string. Non-string errors cannot be modified to have a stack trace.

Why not allow an error handler return multiple values? What I have in mind is two (error value + stack trace string). Currently, 'lua_pcall' silently eats up any additional return values from the error handler.

-asko