[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: suggesting change: lua_pcall error handlers to return multiple values
- From: Asko Kauppi <askok@...>
- Date: Thu, 22 Jan 2009 21:30:05 +0200
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.