lua-users home
lua-l archive

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



On 29/05/2014 23:31, Thiago L. wrote:

On 29/05/2014 23:30, Josh Simmons wrote:
On Fri, May 30, 2014 at 11:44 AM, Thiago L. <fakedme@gmail.com> wrote:
As you all know, chunks take a chunk name string thingy, and it can be
"=<whatever>" if you want to customize the chunk name on error messages and stuff... What if you could make a function handle error message displaying?
Something like...

You already can, just at the call site not the load site.

http://www.lua.org/manual/5.2/manual.html#pdf-xpcall
http://www.lua.org/manual/5.2/manual.html#lua_pcall

Line numbers? stack traceback? etc?
Also pcall/xpcall requires you to "throw" the error again to do error formatting, so this thing would basically be a bit more awesome... (Not sure if the BRs care about awesomeness... I guess I could talk to them IRL one day...)