lua-users home
lua-l archive

Re: Lua 5.3: assert non-string values in #2 cause `(no error message)`-style error message

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


> You could add
> 
> msg = lua_tostring(L, -1);
> if (msg)
> luaL_traceback(L, L, msg, 1);
> 
> after the `lua_pushliteral` call in `msghandler`. (I'd prefer it
> that `msghandler` leaves all to-string conversions to the `report`
> function, though.)
When 'report' is called, there is no stack left to do a traceback.
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /