Re: error/exception hadling in luabind

Daniel Wallin <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Domino wrote:
> Hello,
> 
> My question is how to handle errors that tells something more than "lua
> runtime error". In my code I need multiple scripts for the single lua state
> that shouldn't know about each other so I'm using lua code to load the
> scripts (the code comes from this list by the way). Below is the example of
> the code that I have problem with:

When you catch "luabind::error", the Lua error message will be at the
top of the stack. So you can do lua_tostring(L, -1) to get the error
message.

HTH,
-- 
Daniel Wallin
BoostPro Computing
http://www.boostpro.com

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.