lua-users home
lua-l archive

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


On Thu, Oct 12, 2006 at 01:38:02AM -0400, Glenn Maynard wrote:
> On Thu, Oct 12, 2006 at 02:59:34PM +1000, Nick Gammon wrote:
> > >How are people dealing with error handling in C++?  setjmp doesn't
> > >get along with C++ destructors.
> > 
> > Just to help me understand the question, do you mean:
> > 
> > a. A Lua script calls some C++ code which might throw an exception?
> > 
> > or
> > 
> > b. Some C++ code calls a Lua script that might raise an error?
> 
> A,

Can't the C++ code catch all exceptions, and re-raise with lua_error()?

> and A': C++ calls the Lua C api, which might also throw an error.

Can't it use pcall(), and re-raise with throw?

Sam