[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua compiled as C++ code & exceptions
- From: Alexander Gladysh <agladysh@...>
- Date: Thu, 22 Jan 2009 18:52:05 +0300
> Lua throws 'struct lua_longjmp*' which is an undefined type for
> everyone but itself. maybe you will add some the fully defined type
> could be catched the right way?
>
> take a look here:
>
> int my_func( lua_State *L ) {
> try {
> // blah-blah, possible call funcs from some library
> // call to some Lua function raising error
> // blah, once again
> }
> catch( myexception ) { /* do some great work */ }
> catch( void* ) { throw; /* conceivably Lua exception? */ }
> catch( ... ) { /* general error suicide ;) */ }
> }
>
> using 'catch( void* )' is weird a lot, no one cannot be sure an
> another code isn't raising somthing casting to void*.
Why would you want to catch Lua exceptions outside of Lua code? Why
not use pcall?
Alexander.