On Wed, Jul 17, 2013 at 1:33 AM, Adam Klein <[email protected]> wrote:

> The subject says it all. I'm trying to wrap some code that uses the V8 API
> to throw exceptions (via v8::ThrowException()), and was expecting wrapping
> those calls in a v8::TryCatch to do this for me. But it seems they bypass
> my TryCatch (though with SetVerbose(true) they are at least reported to
> me). Is there something I can do to make the TryCatch completely swallow an
> exception?
>

Why is v8 supposed to know what TYPES of exceptions you throw and how to
convert them to JS exceptions? Some apps throw std::exception, some throw
(my::Exception const &), some throw (SomeMFCType *), and some even through
std::string. There is no 100% generic approach to that. It is easy to write
wrappers which convert such exceptions:

https://code.google.com/p/v8-juice/wiki/V8Convert_FunctionBinding#Converting_Native_Exceptions_to_JS

but it would be impossible for v8 to do that itself because it lacks the
type information.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to