On Sun, Mar 15, 2009 at 10:54 PM, Mads Sig Ager <[email protected]> wrote:
> you should return the empty handle to propagate out the exception.
> There is a bug in the exception propagation code currently which means
> that if you have calls from JS to C to JS to C the propagation of the
> exception might not work correctly.  If you hit that case, the
> workaround is to rethrow the exception (so use the V8 api to throw
> sentry.Exception() and then return the empty handle).

Thanks for that! i've found that this odd scoping approach seems to work for me:

    Handle<Value> jsobj;
    Handle<Value> ex;
    Local<Object> jsobj;
    {
        TryCatch tryer;
        jsobj = ... something which might throw ...
        if( jsobj.IsEmpty() )
        {
            ex = tryer.Exception();
        }
    }
    if( ! ex.IsEmpty() ) ThrowException(ex);

if i don't do that (i.e., if "tryer" is not in a deeper scope) my
exception messages aren't being passed up the chain properly. Weird.


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to