Hi,
       I wrote a code that can raise exception from c++ xpcom and
handle the exception in javascript.  It is compiling well. but is not
working. i.e. js never catch any exceptions


 *****my code for raise exception is  like this (in short)****

  nsCOMPtr<nsIExceptionService> xs =
            do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID);
  nsCOMPtr<nsIExceptionManager> xm;
  xs->GetCurrentExceptionManager(getter_AddRefs(xm));
  nsCOMPtr<nsIException> exception = MyException(); //this is my
implementation

                 // for nsIException
   xm-> SetCurrentException( exception);

******part handle the excpetion in javascript********

try {
   mycom.myfunc (); //this raises the exp
}
catch (e)
{
   //some treatments
}

I want somebody's help to make this thing running..       thanx

_______________________________________________
dev-tech-xpcom mailing list
dev-tech-xpcom@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to