Hamish Allan wrote:
> A quick question:
> 
> Is it possible to return an arbitary exception from C++ XPCOM code, in the
> same way as I might using 'throw' from within JavaScript?


 > Basically I'm looking for the DO_MAGICAL_RETURN_THING() macro in the
 > code below:

Not really.  The best you can do at the moment is to return distinct 
NS_ERROR codes for your exception, and have the JS code check for 
specific integer values, and create messages appropriately.

A bug to allow it to work as you desire is 65080 
(http://bugzilla.mozilla.org/show_bug.cgi?id=65080)

Mark.


Reply via email to